xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cameron McCormack <cam-batik-us...@aka.mcc.id.au>
Subject Re: problem with JPEGTranscoder
Date Tue, 15 Jun 2004 13:13:12 GMT
Hi Patrick.

pegan@gresham-forms.co.uk:
> 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: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message