Last post Feb 02, 2013 01:35 PM by ashish-1983
Member
24 Points
228 Posts
Jan 31, 2013 02:48 AM|shobana raja|LINK
how to remove the panic range tag
" <panicrange><property value="both" type="common"><grt value="both">200</grt></property></panicrange> "from the xml
<?xml version="1.0" encoding="utf-16"?> <referenceranges><referencerange> <property value="both" type="common"> <btw value="both">100 - 200</btw></property> </referencerange> <panicrange><property value="both" type="common"><grt value="both">200</grt></property></panicrange> </referenceranges>
Star
11795 Points
2340 Posts
Jan 31, 2013 02:59 AM|urenjoy|LINK
Check following:
http://stackoverflow.com/questions/8382834/how-to-remove-an-xml-element-from-file
All-Star
52793 Points
9695 Posts
MVP
Feb 02, 2013 10:16 AM|Ruchira|LINK
Hello,
Try this
string filePath = Server.MapPath("xml_file_path_here"); XmlDocument doc = new XmlDocument(); doc.Load(filePath); XmlNode node = doc.SelectSingleNode("panicrange"); node.ParentNode.RemoveChild(node); doc.Save(filePath);
Please 'Mark as Answer' if this post helps you
Contributor
2731 Points
1265 Posts
Feb 02, 2013 01:35 PM|ashish-1983|LINK
http://msdn.microsoft.com/en-us/library/system.xml.linq.xnode.remove.aspx
very simple example
Member
24 Points
228 Posts
how to remove the tag
Jan 31, 2013 02:48 AM|shobana raja|LINK
how to remove the panic range tag
" <panicrange><property value="both" type="common"><grt value="both">200</grt></property></panicrange> "from the xml
<?xml version="1.0" encoding="utf-16"?>
<referenceranges><referencerange>
<property value="both" type="common">
<btw value="both">100 - 200</btw></property>
</referencerange>
<panicrange><property value="both" type="common"><grt value="both">200</grt></property></panicrange>
</referenceranges>
Star
11795 Points
2340 Posts
Re: how to remove the tag
Jan 31, 2013 02:59 AM|urenjoy|LINK
Check following:
http://stackoverflow.com/questions/8382834/how-to-remove-an-xml-element-from-file
All-Star
52793 Points
9695 Posts
MVP
Re: how to remove the tag
Feb 02, 2013 10:16 AM|Ruchira|LINK
Hello,
Try this
string filePath = Server.MapPath("xml_file_path_here"); XmlDocument doc = new XmlDocument(); doc.Load(filePath); XmlNode node = doc.SelectSingleNode("panicrange"); node.ParentNode.RemoveChild(node); doc.Save(filePath);
Please 'Mark as Answer' if this post helps you
My Tech BlogContributor
2731 Points
1265 Posts
Re: how to remove the tag
Feb 02, 2013 01:35 PM|ashish-1983|LINK
http://msdn.microsoft.com/en-us/library/system.xml.linq.xnode.remove.aspx
very simple example