August 2008
Intermediate to advanced
197 pages
3h 23m
English
Since LINQ to XML supports the LINQ standard query operators, an XML document can be loaded in memory and then queried with the usual LINQ query syntax.
Let's start by analyzing a simple query using a couple of important LINQ to XML classes. Listing 3-1 is the XML representation of our People database.
<?xml version="1.0" encoding="utf-8" ?> <people> <!--Person section--> <person> <id>1</id> <firstname>Carl</firstname> <lastname>Lewis</lastname> <idrole>1</idrole> </person> <person> <id>2</id> <firstname>Tom</firstname> <lastname>Gray</lastname> <idrole>2</idrole> </person> <person> <id>3</id> <firstname>Mary</firstname> <lastname>Grant</lastname> <idrole>2</idrole> ... |
Read now
Unlock full access