xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alice Cavallo <me...@media.mit.edu>
Subject Re: Java SAX and SVG files
Date Mon, 29 Nov 2004 16:10:28 GMT
Thank you Thomas,

I set 
factory.setValidating(false); 
than the the SAx Parser gave me the right reading of the SVG file. But
the error (below) showed up at the end. Hopufully when I add this
class to my tool it won't make the whole sapplication  crash.
Do you suggest any free-ware that converts jpg to svg and  conform to
the SVG DTD? 
I think the example I am using was a SVG created by WebDwarf V2.
Error: 

org.xml.sax.SAXParseException: The processing instruction target
matching "[xX][mM][lL]" is not allowed.

	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)

	at javax.xml.parsers.SAXParser.parse(SAXParser.java:281)

	at drawtool.ParseSVG.main(ParseSVG.java:154)


Quoting Thomas DeWeese <Thomas.DeWeese@Kodak.com>:

> Hi Alice,
> 
> Alice Cavallo wrote:
> 
> > I am trying to read and process SVG files from a Java
> application.
> > I am trying to use SAX, but there is some characters that are
> not
> > understood by SAX.
> > For example, the only way SaxParser could read properly the SVG
> file
> > (without any error and outputing the right information) was
> after
> > removing the following comment line :
> > 
> >  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
> > "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
> 
>     This probably indicates that the document doesn't conform to
> the SVG DTD.  Seeing the errors would help confirm this.
> 
> > Can I really read SVG using SaxParser? 
> 
>     Yes, this is exactly what Batik does.
> 
> > Any advice? 
> 
>     Either turn of validation or fix your content so it conforms
> to
> the DTD.
> 
> > I do need a generic
> > method to read any given SVG file and parse the tags and
> attributes.
> 
>     You could look at the Batik
> batik.dom.svg.SAXSVGDocumentFactory
> 
> > Thank you so much and I hope you all had good holidays (for the
> > american crew).
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-dev-help@xml.apache.org
> 




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


Mime
View raw message