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 Rahul Agarwal <re...@yahoo.com> on 2003/07/10 15:04:14 UTC

changing the Tag of an Element

Hi,
   After getting the DOM by parsing the XML document,
is there any way by which I can change the TagName of
any specific element ??

Thanks,
Rahul

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: changing the Tag of an Element

Posted by Joseph Kesselman <ke...@us.ibm.com>.



>Not in DOM Level 2. Edit the tree to remove the old element, insert a new
>one, and copy the children and attributes from old to new.

(Actually, _move_ the children and attrs to the new element rather than
having to copy them. Sorry; wrote the above in a hurry.)

BTW, this is also covered in the DOM FAQ:
http://www.w3.org/DOM/faq.html#rename_node

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: changing the Tag of an Element

Posted by Joseph Kesselman <ke...@us.ibm.com>.



Not in DOM Level 2. Edit the tree to remove the old element, insert a new
one, and copy the children and attributes from old to new.

DOM Level 3 has proposed adding a function to do this which *MAY* work in
*SOME* implementations. (Architected but optional feature; there are many
good reasons why an implementation may not want to support it.)
______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org