Hi

I am currently writing an application that involves storing nodes from an
SVG document in a database, and then being able to retrieve them and place
them into a new SVG document.

I am able to get the string representation of the node using: 

String xml = DOMUtilities.getXML(group); (where group is the node required). 
I have checked the string and it looks correct (although any g nodes seem to
have the id printed twice, is there any reason for that?).

The trouble comes when I try to parse the XML back into a document.  I am
using the DOMUtilities.parseXML method to parse the XML back to a node (and
preferably into a document) but it doesn't seem to work, I have an
xlink:href element in my document which may be complicating things but I
think part of the problem is not knowing what elements I need to pass into
the method (especially the wrapperElementName).

My section of code used is:

HashMap<String,String> map = new HashMap<String,String>();
map.put("xlink", "http://www.w3.org/1999/xlink";);
Node in = DOMUtilities.parseXML(str, svgDoc, docURI, map, "svg",
svgFactory);

where str is the string that was created with the getXML method, svgDoc is
the document I want to add the node to, docURI is the URI of the document
and svgFactory is the document factory that svgDoc was created with
originally.

I have tried numerous things including leaving svgDoc null (although I
didn't know what the uri should be then), having the wrapperElementName and
prefixes map as null (which I imagine doesn't work because of the xlink
namespace requirement).

Does anyone know what I'm doing wrong and can suggest where to look next? 
I'm really getting frustrated with this now.

Jon
-- 
View this message in context: 
http://www.nabble.com/Convert-String-to-Node-tp16091934p16091934.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to