xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bishop, Michael W. CTR USJFCOM JFL" <michael.bishop....@jfcom.mil>
Subject RE: Create SVGDocument by loading XML
Date Wed, 22 Apr 2009 20:55:24 GMT
You want a SAXSVGDocumentFactory.  It has methods for loading XML:
private static String className = XMLResourceDescriptor.getXMLParserClassName();

private static SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(className);



From: Jan Tosovsk√Ĺ [mailto:j.tosovsky@tiscali.cz]
Sent: Wed 4/22/2009 4:16 PM
To: batik-users@xmlgraphics.apache.org
Subject: Create SVGDocument by loading XML

Hello Everyone,

I am trying to create new SVG document by parsing ByteArray as Stream:
1. DocumentBuilder builder =
2. SVGDocument svgDocument = (SVGDocument)builder.parse(new

This method fails on 2nd line: java.lang.ClassCastException:
org.apache.xerces.dom.DeferredDocumentImpl cannot be cast to
org.w3c.dom.svg.SVGDocument at ...

If SVGDOMImplementation is used, it offers only to create new document, not
to parsing existing one:
SVGDocument d = (SVGDocument)
SVGDOMImplementation.getDOMImplementation().createDocument(SVGNS, "svg",

Is there any possibility to create SVG document from existing XML code?


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

View raw message