xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Tošovský <j.tosov...@tiscali.cz>
Subject Create SVGDocument by loading XML
Date Wed, 22 Apr 2009 20:16:30 GMT
Hello Everyone,

I am trying to create new SVG document by parsing ByteArray as Stream:
1. DocumentBuilder builder =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
2. SVGDocument svgDocument = (SVGDocument)builder.parse(new
ByteArrayInputStream(svgStream.toByteArray()));

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",
null);

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

Jan


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


Mime
View raw message