xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danny Ayers" <danny...@virgilio.it>
Subject RE: Problem with Document.getElementsByTagName("g")
Date Tue, 07 May 2002 23:14:17 GMT
Hi Vicki,

I've had a play with your code and get the same results. If I wasn't just
off to bed (1.15) I'd try your code with appropriate tweaks using the full
crimson parser.

I've not had chance to check out the source, but I've a feeling that there
may be a few uncovered holes between what Batik uses of the crimson parser
and the full crimson parser. I've not had any major problem converting
generic DOM code between Xerces and Crimson, but found it impossible to use
the Batik generic stuff to load arbitrary XML. My own query on this topic
remains unanswered :-(

Cheers,
Danny.






---
Danny Ayers
<stuff> http://www.isacat.net </stuff>


  -----Original Message-----
  From: Vicki Bell [mailto:vicki.bell@avenida.co.uk]
  Sent: 07 May 2002 20:10
  To: batik-users@xml.apache.org
  Subject: Problem with Document.getElementsByTagName("g")


  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

  vicki.bell@avenida.co.uk

  Tel: +44 (0)2476 430462




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


Mime
View raw message