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]

Reply via email to