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

Scott Klein

"Professional LINQ"

Element("Employee").Element("Name"),
from att in emp.Element("Employee").Attributes()
where att.Name == "id"
select new XElement(att.Name, (string)att));
It produces the following XML tree:

Scott
1

157
Part II: LINQ to XML
You??™re beginning to see how efficient it is to use functional construction to modify and manipulate XML.
Although in some cases it may not be any easier, especially on much larger XML documents, the functional
construction approach still provides a number of benefits over other methods, such as the ability
to produce code that is easier to read and maintain. Functional construction lends itself to greater productivity,
regardless of the size of the XML document.
LINQ to XML Annotations
LINQ to XML supports the concept of annotations. In layman??™s terms, an annotation is an explanatory
note associated with some text. An annotation in LINQ to XML is not that different??”it is the capability
to add, or associate, an object to an XML node or attribute. It can be any object of any arbitrary type.


Pages:
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6