BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


XML DOM
How to create a navigator with XmlDocument and CreateNavigator?
Whats the 'push model'?
Hybrid Model Part Two: Choosing between SAX and DOM


 
 

<< XHTMLXmlSerializer >>


By Sonu Kapoor
First Posted 02/20/2005
Times viewed 1825

How to remove an attribute with XmlDocument and RemoveAll?


Summary How to remove an attribute with XmlDocument and RemoveAll?

The current section contains lot examples to edit, create or update XML elements or attributes. However you havent seen any example which will remove an attribute. In this example I will show you how you can remove an attribute. The key to remove the attribute is to use the RemoveAll() function from the XmlDocument class. It is important to understand how this function is to be used. If you call the function on a node which doesn't have an attribute then it will delete all child nodes. If the you can this funtion on a node which contains an attribute, it will only delete the attribute. Here is an example which illustrates the first scenario (the function is called over a node which does not have an attribute). In both examples I will use the same XML file.

Additional information

Further additional information


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< XHTMLXmlSerializer >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML