Hi,

 

I am trying to convert some (pre-batik) java code that uses Xerxes to use Batik instead. However, I can’t get the code to work. When I use Batik to parse an SVG document from an InputStream I find that calling getElementsByTagName(“g”) does not return the same result as when using Xerxes. It returns an empty list, although the document contains a number of “g” tags and I can get a “g” tag node directly by calling getElementById (…) on the Document.

 

Attached are a test program and SVG document that illustrate the problem. The program parses the SVG document from a FileInputStream first using Xerxes and then using Batik and outputs the number of “g” tags found by calling getElementsByTagName on the resulting Documents.

 

I must admit my knowledge of XML/SVG is limited (I didn’t write the code I am converting) so apologies if I have overlooked something obvious.

 

Am I using Batik (or Xerxes) incorrectly? Is there anything special about “g” nodes from the perspective of Batik that I need to take account of? If not, has anyone encountered a similar problem?

 

Thanks,

Vicki

 

---------------------------------------

Vicki Bell

Avenida Technologies Ltd

[EMAIL PROTECTED]

Tel: +44 (0)2476 430462

 


Attachment: NoddyTest.java
Description: JavaScript source

Attachment: noddyTest.svg
Description: image/svg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to