xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joel Uckelman <uckel...@nomic.net>
Subject Batik and invalid SVG
Date Fri, 09 Apr 2010 20:06:28 GMT
Our application is fed invalid SVG from time to time; we'd like to be
able to handle that in a graceful way. For example, today I came across
some SVG containing this,

  <comment>rotation angles = -arctan(8/9)</comment>

which causes a DOMException because "comment" isn't a valid SVG element.
Now, lots of SVG viewers will still display the image because they can
ignore bad elements. Is there a way to get Batik to do this? (Or, is
there at least a guide to what exceptions can occur when reading SVG
so that we can catch them and notify the user that loading failed because
the SVG is bad? The DOMException I got took me completely by surprise,
since it's unchecked and not documented anywhere I've seen that a
DOMException can be thrown by SAXSVGDocumentFactory.createDocument().)


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

View raw message