Hello,

In the meantime i found a workaround but the only problem ist that thr uri is 
not set...

                //
                // Clone SVG document
                //
                 Document docOrg = svgDoc;   // your original document
                 DOMImplementation impl = docOrg.getImplementation();
                 Document docNew;        // your new document
                 docNew = impl.createDocument("http://www.w3.org/2000/svg";, 
"svg", null);
                 
docNew.replaceChild(docNew.importNode(docOrg.getDocumentElement(), true),
                                 docNew.getDocumentElement());
                 SVGDocument doc = (SVGDocument) docNew; 

So if make doc.getURL(); null is returned !


Mit freundlichen Grüßen Michael


-----Ursprüngliche Nachricht-----
Von: Kerschbaum Michael [mailto:[email protected]] 
Gesendet: Dienstag, 18. August 2009 15:48
An: [email protected]
Betreff: AW: Problem with clone document.. 1.7 okay => 1.8pre not

Hello,

Thanks for quick reply...

Version is 1.8 from SVN so from today (so after 6.AUG.2009) ?! I saw that 10 is 
DOCUMENT_TYPE_NODE... The types are defined in the Node class. I didn't check 
if something changed since 1.7 ...

There is no version of SVG defined in the document i am using ? Where can i see 
which svg version the file is ?? The files were generated from Microsoft 
Visio...

It happens with every svg i am using (... This are only a very small one ...)


Mit freundlichen Grüßen Michael

-----Ursprüngliche Nachricht-----
Von: Helder Magalhães [mailto:[email protected]]
Gesendet: Dienstag, 18. August 2009 15:33
An: [email protected]
Betreff: Re: Problem with clone document.. 1.7 okay => 1.8pre not

Hi Michael,


> SVGDocument doc = (SVGDocument) svgDoc.cloneNode(true);

> In the 1.7 batik it works.... in the 1.8pre not ! see error above...

Please always state in which SVN revision (or nightly build date) did this 
occur: "1.8pre" alone is not sufficient...


>  switch (importedNode.getNodeType()) {
>
> .... and the type is 10 .. so it goes to default and throws the 
> exception

Type 10 stands for DOCUMENT_TYPE_NODE [1] (<!DOCTYPE ...). Note that "There is 
no DTD for SVG 1.2" [2] so you may simply leave it out.
Nevertheless, I believe it would be useful if you could reduce and attach a 
small SVG file which would raise such exception (I'd say you only need to leave 
the doctype and little more).

That makes me wonder: are you trying to clone a SVG 1.1 document into a 1.2 or 
vice-versa? I'm not sure if Batik is able to do that (it can be unsupported or 
an underlying bug, more information is required).


Hope this helps,
 Helder


[1] http://www.w3schools.com/Dom/dom_nodetype.asp
[2] http://www.w3.org/TR/SVGTiny12/intro.html#defining

---------------------------------------------------------------------
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