April 2008
Intermediate to advanced
704 pages
17h 49m
English
Problem
You need to modify an XML document by inserting new data.
Solution
Use one of the available add methods (Add, AddAfterSelf, AddBeforeSelf, or AddFirst) of the XElement class, passing in an instance of the XElement or XAttribute object to create.
How It Works
The XElement class provides the following methods for inserting new elements and attributes into an existing XML tree:
Add adds the specified element(s) or attribute(s) to the current XElement. The element(s) or attribute(s) are added at the end of any existing ones.
AddAfterSelf and AddBeforeSelf add the specified element(s) or attribute(s) before or after the current XElement.
AddFirst adds the specified element(s) at the top of the elements ...
Read now
Unlock full access