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 Bastien DEBLAIS <bd...@iftechnologies.net> on 2005/07/22 15:56:46 UTC
Parsing XML
Hi,
I want to use "public org.w3c.dom.DocumentFragment parseXML(java.lang.String text,
org.w3c.dom.Document doc)"
but how to use the "getURL" and so the "getURLDone"??
My Code:
UserAgentAdapter userAgent = new UserAgentAdapter();
GVTBuilder builder = new GVTBuilder();
BridgeContext ctx = new BridgeContext(userAgent);
ctx.setDynamic(true);
builder.build(ctx, doc);
BaseScriptingEnvironment scriptEnvironment = new BaseScriptingEnvironment(ctx);
Window newwin = scriptEnvironment.createWindow();
//newwin.getURL(svgURI2, getURLDone());
//Node mynode = newwin.parseXML(svgURI1, doc);
//svgRoot.appendChild(mynode);
FileOutputStream outStream = new FileOutputStream("C:/out.svg");
Writer outf = new OutputStreamWriter(outStream, "UTF-8");
DOMUtilities.writeDocument(doc,outf);
outf.flush();
thanks to reply.
Best regards.
Re: Parsing XML
Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Bastien,
Please use the batik.dom.svg.SAXSVGDocumentFactory class to parse XML
from Java.
Bastien DEBLAIS wrote:
>
> Hi,
> I want to use " public org.w3c.dom.DocumentFragment
> *parseXML*(java.lang.String text,
> org.w3c.dom.Document doc)"
> but how to use the "getURL" and so the "getURLDone"??
>
> My Code:
> UserAgentAdapter userAgent = new UserAgentAdapter();
> GVTBuilder builder = new GVTBuilder();
> BridgeContext ctx = new BridgeContext(userAgent);
>
> ctx.setDynamic(true);
> builder.build(ctx, doc);
> BaseScriptingEnvironment scriptEnvironment = new
> BaseScriptingEnvironment(ctx);
>
> Window newwin = scriptEnvironment.createWindow();
>
> / //newwin.getURL(svgURI2, getURLDone());
> //Node mynode = newwin.parseXML(svgURI1, doc);
> //svgRoot.appendChild(mynode);/
>
> FileOutputStream outStream = new
> FileOutputStream("C:/out.svg");
> Writer outf = new OutputStreamWriter(outStream, "UTF-8");
>
> DOMUtilities.writeDocument(doc,outf);
> outf.flush();
>
> thanks to reply.
> Best regards.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org