You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> on 2006/06/07 20:02:37 UTC

Parsing String data into an SVG document?

If I receive a snippet of XML as a String, I'd like to create an
SVGDocument from it.  The ultimate goal is to import it into another
document.  In the case of whiteboarding over XMPP, I receive the
following:

 

<rect x="10" y="10" width="10" height="10"/>

 

I'd like to use the SAXSVGDocumentFactory to load this as an
SVGDocument.  The only way I can see how to do this is to provide a URI.
Is there a way I can go from String data to SVGDocument?  The ultimate
goal is to receive a String and import it as a Node in my whiteboard.
My solution was to create an SVGDocument based on the String data, then
import the node from one document to the other.  I'm struggling with
going from String -> DOM.

 

Michael Bishop


Re: Parsing String data into an SVG document?

Posted by th...@kodak.com.
Hi Michael,

   I would suggest looking at the code for:
        batik.bridge.ScriptingEnvironment.parseXML for how to accomplish 
this...


"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on 
06/07/2006 02:02:37 PM:

> If I receive a snippet of XML as a String, I?d like to create an 
SVGDocument 
> from it.  The ultimate goal is to import it into another document.  In 
the 
> case of whiteboarding over XMPP, I receive the following:
> 
> <rect x=?10? y=?10? width=?10? height=?10?/>
> 
> I?d like to use the SAXSVGDocumentFactory to load this as an 
SVGDocument.  The
> only way I can see how to do this is to provide a URI.  Is there a way I 
can 
> go from String data to SVGDocument?  The ultimate goal is to receive a 
String 
> and import it as a Node in my whiteboard.  My solution was to create an 
> SVGDocument based on the String data, then import the node from one 
document 
> to the other.  I?m struggling with going from String -> DOM.
> 
> Michael Bishop

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