Additional XML Capabilities

In the previous two chapters, I demonstrated how to create, modify, and traverse XML data with the LINQ to XML API. I also demonstrated the building blocks for creating powerful XML queries. I hope by now you would agree that LINQ to XML will handle about 90 percent of your XML needs, but what about the remaining 10 percent? Let's see if we can get that percentage higher. If Microsoft added schema validation, transformations, and XPath query capability, what percentage of your use cases would that achieve?

While I have covered the new LINQ to XML API and how to perform the most basic of queries with it, I have yet to demonstrate slightly more complex, real-world queries. In this chapter, I provide some examples that will hopefully make querying XML with the LINQ to XML API seem trivial, including some that use the query expression syntax for those of you who prefer it.

Additionally, the new LINQ to XML API just wouldn't be complete without a few additional capabilities such as transformation and validation. In this chapter, I cover these LINQ to XML leftovers, as well as any other good-to-know information.

Specifically, I cover how to perform transformations with XSLT and without. I demonstrate how to validate an XML document against a schema, and I even present an example performing an XPath-style query.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset