Professional in C# and Visual Basic Part 58. Building on the revolutionary release, adds several key new developer features including AJAX, LINQ, and a new CSS designer in Visual Web Developer 2008. The dramatic reduction in code that developers realized from the more than 50 new server controls in now allows developers the time to make their applications more interactive with AJAX, to work with data in their preferred language with LINQ, and to build visually attractive and consistent standards-based sites with CSS. . | Chapter 10 Working with XML and LINQ to XML b http All books whose price is not greater than For Each node As XPathNavigator In _ b book not b price . b price namespaceMgr Dim price As Decimal _ CType GetType Decimal Decimal Price is 0 BR _ price Next C Load document string booksFile XPathDocument document new XPathDocument booksFile XPathNavigator nav Add a namespace prefix that can be used in the XPath expression XmlNamespaceManager namespaceMgr new XmlNamespaceManager b http All books whose price is not greater than foreach XPathNavigator node in b book not b price . b price namespaceMgr Decimal price decimal typeof decimal Price is 0 BR price If you then want to modify the underlying XML nodes in the form of an XPathNavigator you would use an XmlDocument instead of an XPathDocument. Your XPath expression evaluation may slow you down but you will gain the capability to edit. Beware of this tradeoff in performance. Most often you will want to use the read-only XPathDocument whenever possible. Listing 10-13 illustrates this change with the new or changed portions appearing in gray. Additionally now that the document is editable the price is increased 20 percent. Listing 10-13 Querying and editing XML with XmlDocument and XPathNodeIterator VB Load document Dim booksFile As String Dim document As New XmlDocument booksFile Dim nav As XPathNavigator Add a namespace prefix that can be used in the XPath expression Dim namespaceMgr As New XmlNamespaceManager b http All books whose price is not greater than For Each node As XPathNavigator In _ 527 Chapter 10