SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 217 | Next

Scott Klein

"Professional LINQ"

By doing so, you can nest elements, creating child
elements of the parent element. The following example illustrates this, using the XElement constructor
from the initial XElement class to create a child element below the root element:
XElement employee = new XElement("Root",
new XElement("Employee");
The code produces the following XML:



From here, another XElement constructor can be used to create a new element with a specified name and
content. Here??™s the basic syntax:
XElement(XName name, object content)
The following example creates a new element with the specified name of "Name" and content of "Scott":
XElement = new XElement("Name", "Scott")
Here??™s the XML this code produces:
Scott
You can combine this with the previous example to create a root element and child element with a value:
XElement employee = new XElement("Employee",
new XElement("Name", "Scott");
The code produces the following XML:

Scott

Last, you can pass multiple instances of the XElement class to create multiple nodes.


Pages:
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6