Hello Thomas,

I tried the harder way, but I can't figure out how to do it:
You wrote

The _slightly_ harder (but much better) way to fix this would
be to construct an instance of our SVG DOM (batik.dom.svg.SVGDOMImplementation). This will result in a
batik.dom.svg.SVGOMDocument object being used,

which seems reasonable - but how to insert the data I read from my hard drive into the SVGOMDocument? I tried ImportNode(node, boolean) as well as replaceChild(node, node) (using the DocumentElements as nodes to be replaced and node to replace, respectively), but they invariably, this results in exceptions like "Cannot import node".

Currently, my code looks like this:

public void loadDocument(Document svgDoc) throws Exception{
String svgNS=SVGDOMImplementation.SVG_NAMESPACE_URI;
DOMImplementation impl=SVGDOMImplementation.getDOMImplementation();
SVGOMDocument useDoc=(SVGOMDocument)impl.createDocument(svgns,"svg",null);
useDoc.replaceChild(useDoc.getDocumentElement(),svgDoc.getDocumentElement()); useDoc.setURLObject(new URL("My/URL/MySVG.svg"));
canvas.setDocument(useDoc); //canvas is of type JSVGCanvas
}


I don't think that I have to reconstruct the entire document by hand, so I have to be 
missing
something - is there a way to import the complete document-structure of one document to
another?

Thanks again
-Urs


Urs Reupke wrote:

up to now I used LoadSVGDocument(URL) to load files to display, and it was good - but when today, for various reasons, I tried to convert the program to use SetDocument,
things failed miserably:


Using JDOM 1.0, I wrote a method to read the SVG-File as a JDOM Document, afterwards convert it to a w3c.dom Document, and finally pass this w3c.dom Document
to the setDocument(w3c.dom.Document)-Method of my JSVGCanvas.
I didn't expect trouble at this stage, but it came: Instead of displaying everything, only
"direct content" is displayed, images embedded via the <symbol>-Tag aren't shown.
Which is bad, because my images are of quite repetitive content and rely on
<symbol>/<use>.


Can you point me to a solution for the problem?
Thank you
-Urs

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


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



Reply via email to