For some reason, the Squiggle in the Batik I have checked-out from SVN (and
not updated for a few weeks) is giving an error opening certain SVG files.
Neither Batik or the document have changed in the last few weeks and yet now
when I try to open an SVG document that does not contain this line at the
top:

 

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>

 

I get this exception:

 

org.apache.batik.dom.util.SAXIOException: Document is invalid: no grammar
found.

                at
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFacto
ry.java:445)

                at
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFacto
ry.java:357)

                at
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(SAXSVGDocument
Factory.java:201)

                at
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createSVGDocument(SAXSVGDocum
entFactory.java:124)

                at
org.apache.batik.bridge.DocumentLoader.loadDocument(DocumentLoader.java:106)

                at
org.apache.batik.swing.svg.SVGDocumentLoader.run(SVGDocumentLoader.java:84)

Caused by: org.xml.sax.SAXParseException: Document is invalid: no grammar
found.

                at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseEx
ception(ErrorHandlerWrapper.java:195)

                at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandl
erWrapper.java:131)

                at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErro
rReporter.java:384)

                at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErro
rReporter.java:318)

                at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartEl
ement(XMLNSDocumentScannerImpl.java:250)

                at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDr
iver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)

                at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$Fragm
entContentDriver.next(XMLDocumentFragmentScannerImpl.java:3095)

                at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.
next(XMLDocumentScannerImpl.java:921)

                at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocum
entScannerImpl.java:648)

                at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSD
ocumentScannerImpl.java:140)

                at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanD
ocument(XMLDocumentFragmentScannerImpl.java:510)

                at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Con
figuration.java:807)

                at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Con
figuration.java:737)

                at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:10
7)

                at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractS
AXParser.java:1205)

                at
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFacto
ry.java:439)

                ... 5 more

If I add the omitted line then everything is fine again.  But given that I
used to be able to open SVG files containing nothing more than the
<svg></svg> tags and that nothing has changed in either the document or in
Squiggle itself, what could possibly be causing this exception?  Are there
some external factors that influence SVG document validation?

 

Thanks,

 

-JCT

Reply via email to