Skip to Content
.NET & XML
book

.NET & XML

by Niel M. Bornstein
November 2003
Intermediate to advanced
476 pages
14h 38m
English
O'Reilly Media, Inc.
Content preview from .NET & XML

Chapter 6. Navigating XML with XPath

Once you have an XmlDocument in memory, you could choose to navigate through its nodes by using XmlNodeReader to read each node and do some action if it was of the desired type. Or, you could recursively iterate through its child nodes, interrogating each child node’s node type and name, until you reach the one you’re interested in. Or, you could use XPath.

In this chapter, I’ll introduce the XPath specification, the syntax of XPath expressions, and some of its typical uses. Then I’ll show you the System.Xml.XPath assembly, and how it allows you to use XPath in your .NET applications. Finally, I’ll go through some examples using XPath.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Applied XML Programming for Microsoft® .NET

Applied XML Programming for Microsoft® .NET

Dino Esposito
XML Hacks

XML Hacks

Michael Fitzgerald

Publisher Resources

ISBN: 0596003978Supplemental ContentErrata