03.01.2015 Views

C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

546 ❘ CHAPTER 24 XML<br />

(continued)<br />

Method<br />

Nodes<br />

NodesAfterSelf<br />

NodesBeforeSelf<br />

Parse<br />

Remove<br />

RemoveAll<br />

RemoveAttributes<br />

RemoveNodes<br />

ReplaceAll<br />

ReplaceAttributes<br />

ReplaceNodes<br />

ReplaceWith<br />

Save<br />

SetAttributeValue<br />

SetElementValue<br />

SetValue<br />

ToString<br />

WriteTo<br />

Purpose<br />

Returns a collection holding this element’s child nodes.<br />

Returns a collection holding the node’s siblings that come after<br />

this node.<br />

Returns a collection holding the node’s siblings that come before<br />

this node.<br />

Creates an XElement from an XML string.<br />

Removes this element from its parent.<br />

Removes all nodes and attributes from this element.<br />

Removes this element’s attributes.<br />

Removes this element’s child nodes.<br />

Replaces the element’s child nodes and attributes with specified<br />

new ones.<br />

Replaces the element’s attributes with specified new ones.<br />

Replaces the element’s child nodes with specified new ones.<br />

Replaces this node with new specified content.<br />

Saves the element into a file, stream, or writer.<br />

Sets, adds, or removes an attribute.<br />

Sets, adds, or removes a child element.<br />

Sets the element’s value.<br />

Returns the element’s indented XML code.<br />

Writes the element into an XmlWriter.<br />

An object model is handy if you need to roam through its structure to examine data and make<br />

changes, but the XmlWriter class still has its uses. A document model must contain all the elements<br />

that make up the XML data. If you’re building an enormous model, the DOM structure will take<br />

up a lot of memory.<br />

In contrast an XmlWriter doesn’t remember what it wrote in the past so it can write even huge<br />

XML documents without using up a lot of memory. However, many programmers find XmlWriter<br />

more cumbersome than the DOM so they prefer the DOM.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!