Click here to Skip to main content
15,914,780 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I have one xml like

XML
<ROOT><EMPLOYEE NAME='SUMAN' PHONE='999XXXXXXXX'></EMPLOYEE></ROOT>


I want to get only
XML
<root></root>
from the above XML using javascript.

Please can anyone tell me how can i get the same in javascript.

Thanks and Regards
Suman Zalodiya
Posted
Updated 2-Jul-13 4:28am
v2
Comments
Prasad Khandekar 2-Jul-13 10:30am    
What all things have you tried so far?

1 solution

The "documentElement" property points to the root element. Are you trying to make an empty copy of the document element? If so, use "cloneNode(false)":
JavaScript
new_node = xmlDoc.documentElement.cloneNode(false);
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900