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 193 | Next

Scott Klein

"Professional LINQ"

NET Framework is that indentation is automatically done for
you. That makes reading it much easier because it mimics the format and structure of XML. (Oh, by the
way, anyone who follows the supercross/motocross scene knows that Ricky Carmichael??™s nickname is
not a reference to the animal, but to his achievements in the sport. GOAT: Greatest of All Time.)
Now modify the previous example by adding the highlighted line of code:
XElement xdoc = new XElement("Riders",
new XElement("Rider",
new XElement("Name", "Ricky Carmichael",
new XAttribute("Class", "450")),
new XElement("NationalNumber", "4"),
new XElement("Mechanic", "Mike Gosselaar"),
new XElement("Nickname", "GOAT")
)
);
Notice the results now show an attribute called Class on the Name element:


Ricky Carmichael
4
110
Chapter 5: Understanding LINQ to XML
Mike Gosselaar
GOAT


LINQ to XML also provides a simple yet powerful mechanism for creating an XML tree in a single
statement.


Pages:
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6