Thanks for all your help but I still have one question, won't this return a Document type when what I really need is a SVGDocument? I know that you mentioned casting the document, but it seems that an explicit cast only throws a ClassCastException e.g. Document d = Util.string2Dom(xmlString); JSVGCanvas canvas = new JSVGCanvas(); canvas.setSVGDocument((SVGDocument)d);
The above throws a class cast exception. Is there some sort of conversion utility that I need to be using instead of an explicit cast? Joe Foster > -----Original Message----- > From: tomas lin [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 15, 2003 4:36 PM > To: Batik Users; [EMAIL PROTECTED] > Subject: Re: Loading a SVG Document from a String > > > That last part should look something like this.... > > public static Document string2Dom(String xml) > throws ParserConfigurationException, IOException, SAXException > { > if(db == null) { > DocumentBuilderFactory dbf = > DocumentBuilderFactory.newInstance(); > db = dbf.newDocumentBuilder(); > } > return db.parse(new InputSource(new StringReader(xml ) ) ); > } > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]