for (Node n = importedNode.getFirstChild();
n != null;
n = n.getNextSibling()) {
result.appendChild(importNode(n, true));
}
}
return result;
----- Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 15 June 2004 16:42
To: [EMAIL PROTECTED]
Subject: RE: problem with JPEGTranscoderHi Cameron and Venkat,
I'm using 1.5.1.
I misread the code the first time (saw the setAttributeNodeNS but missed the fact the the Attr a was being passed in the recursive call, apologies), now I do not understand how it can be working.It does still appear to work for me ! I am trying to work out why ?
Patrick
-----Original Message-----
From: Cameron McCormack [mailto:[EMAIL PROTECTED]]
Sent: 15 June 2004 14:13
To: [EMAIL PROTECTED]
Subject: Re: problem with JPEGTranscoder
Hi Patrick.
[EMAIL PROTECTED]:
> I have not noticed any problem with DeepCloneDocument, but because am using
> this method in my code I felt compelled to check it out.
> I may wrong but on having a look it appears to me that
> AbstractDocument.importNode copies the node values at the point it handles
> the ELEMENT_NODE.
> .....
> case ELEMENT_NODE:
> Element e = createElementNS(importedNode.getNamespaceURI(),
> importedNode.getNodeName());
> result = e;
> if (importedNode.hasAttributes()) {
> NamedNodeMap attr = importedNode.getAttributes();
> int len = attr.getLength();
> for (int i = 0; i < len; i++) {
> Attr a = (Attr)attr.item(i);
> if (a.getSpecified()) {
> e.setAttributeNodeNS((Attr)importNode(a, true));
> }
> }
> }
> break;I think the problem is that importNode will create a new attribute in
the SVG DOM with the right name but it won't actually set the
attribute's value. Notice how in importNode the cases for text nodes,
CDATA sections and comments nodes do something to get the to-be-copied
node's value, while for the attributes it doesn't.<caveat>
I haven't tested it though, so if the attribute values actually come
from somewhere else in the code that I haven't noticed, I could be
wrong.
</caveat>But you say that it works for you? What version of Batik are you using?
Cameron
--
Cameron McCormack
| Web: http://mcc.id.au/
| ICQ: 26955922---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com
_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com