You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Sheng Huang <sh...@xperient.net> on 2002/12/12 22:03:58 UTC

FW: Question about HTML support of Batik

I am doing a project which is a cross-media content management system.
The basic component is an SVG-based Applet. Now my application can work
with SVG, CSS and JavaScript, but I can't make the HTML style link work.
Since our goal is to display everything on the JSVGCanvas, when a user
clicks on a link in an SVG file which is in the form of <a
xlink:href="http://www.xperient.com/index.html">, we want to display the
HTML code on the JSVGCanvas. But the error I got is:

SVG Error:

The current document is unable to create an element of the requested
type (namespace:http://www.w3.org/2000/svg,name:html).

java.io.IOException: The current document is unable to create an element
of the requested type (namespace: http://www.w3.org/2000/svg, name:
html).
      at
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown
Source)
      at
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown
Source)
      at
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown
Source)
      at
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createSVGDocument(Unknown
Source)
      at org.apache.batik.bridge.DocumentLoader.loadDocument(Unknown
Source)
      at org.apache.batik.swing.svg.SVGDocumentLoader.run(Unknown
Source)


Does Batik currently support this kind of functionality? I doubt about
this because I also tested with Squiggle browser of Batik distribution
and it also did not work. Since this functionality is essential to our
project, could you give me some suggestion to work around this question
if Batik does not support? Thank you very much for your help. 
 

With best regards,

William


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: FW: Question about HTML support of Batik

Posted by J Aaron Farr <ja...@yahoo.com>.
On Thu, 2002-12-12 at 16:03, Sheng Huang wrote:
> I am doing a project which is a cross-media content management system.
> The basic component is an SVG-based Applet. Now my application can work
> with SVG, CSS and JavaScript, but I can't make the HTML style link work.
> Since our goal is to display everything on the JSVGCanvas, when a user
> clicks on a link in an SVG file which is in the form of <a
> xlink:href="http://www.xperient.com/index.html">, we want to display the
> HTML code on the JSVGCanvas. But the error I got is:

[snip]

> 
> Does Batik currently support this kind of functionality? I doubt about
> this because I also tested with Squiggle browser of Batik distribution
> and it also did not work. Since this functionality is essential to our
> project, could you give me some suggestion to work around this question
> if Batik does not support? Thank you very much for your help. 
>  
> 
> With best regards,
> 
> William
> 

Last I checked, Batik's JSVGCanvas does _not_ support HTML.  (Someone
correct me if I'm wrong).

I had this same issue and there were a couple of ways to handle it (I'm
sure someone else can think of a few more):

-- Create a LinkListener (I forget where it is, but it's in the Batik
API) and have the link listener filter any "html" links.  Then, render
the link in a new frame that can handle HTML. 

-- Use javascript's onclick() rather than a normal link and open a new
frame that can render the HTML (this is what I did).

My requirements were a little different since I needed links to open in
a seperate window, but it could be done in the same window by replacing
the JSVGCanvas by a new panel/frame.

Sorry if this is somewhat vague, but it's been a little while and I
don't have my code with me.  Perhaps I dig up some specifics for my
implementation tomorrow.

Good luck!

jaaron

-- 
  jaaron    <ja...@yahoo.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org