You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Daniel Siino <DS...@Intellitrans.com> on 2004/11/12 18:28:03 UTC

ID attribute of newly appended node not of type ID

Hi,
 
I'm parsing an SVG file and able to retrieve existing group (g) node using
getElementById. However, I am not able to retrieve nodes that have been
added to the DOM using appendChild. I tried both getElementById and the
XPathAPI. The only way to see the new nodes is to loop thru the NodeList.
The DTD does declare id attribute as type ID for all element. The new nodes
are created in the SVG namespace. When stepping thru the debugger, I see
that the type of the attribute is null as opposed to ID.
 
I also tried using setIdAttribute from the Attr API.
Attr attr = doc.createAttribute("id");
attr.setValue("123");
((AttrImpl)attr).setIdAttribute(true);
 
 
Do I have to re-parse the document in order to retrieve new nodes with
getElementById?
 
Regards 
 
Daniel