Listing 1: Convert XPath into LINQ to XML: XML: Build a Basic Structure

XML structures vary widely in arrangement, complexity, and whether the data is held in content or attributes. A variation of this sample XML is used throughout this article.

 <?xml version="1.0" encoding="utf-8"?>
<!-- From Microsoft Sample Files with a namespace 
   added -->
<Root xmlns="http:CustomersAndOrder">
      <Customer CustomerID="GREAL">
      <!-- Etc. -->
         <Address>2732 Baker Blvd.</Address>
         <!-- Etc. -->
         <!-- Etc. -->
         <!-- Etc. -->
         <ShipInfo ShippedDate=
         <!-- Etc. -->
      <!-- Etc. -->
comments powered by Disqus
Most   Popular
Upcoming Events

.NET Insight

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.