Skip to Main Content
C# in a Nutshell
book

C# in a Nutshell

by Ben Albahari, Ted Neward, Peter Drayton
March 2002
Intermediate to advanced content levelIntermediate to advanced
864 pages
31h 8m
English
O'Reilly Media, Inc.
Content preview from C# in a Nutshell

Name

XPathDocument

Synopsis

This class is a concrete implementation of IXPathNavigable for creating an XPathNavigator that knows how to scan through an XML document. There are overloaded forms of the constructor designed to pull an XML document from various sources—a System.IO.Stream, a string, a System.IO.TextReader (which presumably is pulling from some other valid data source), or a System.Xml.XmlReader. Note that if the XmlReader is currently positioned on top of a particular node within a document, the constructed XPathDocument instance is only valid for that element and its children. This allows partial XPath scans of a given document.

This class serves no other purpose than as a factory for producing XPathNavigator instances.

public class XPathDocument : IXPathNavigable {
// Public Constructors
   public method XPathDocument(System.IO.Stream stream);  
   public method XPathDocument(string uri);  
   public method XPathDocument(string uri, 
        System.Xml.XmlSpace space);  
   public method XPathDocument(System.IO.TextReader reader);  
   public method XPathDocument(System.Xml.XmlReader reader);  
   public method XPathDocument(System.Xml.XmlReader reader, 
        System.Xml.XmlSpace space);  
// Public Instance Methods
   public method XPathNavigator CreateNavigator();               // implements IXPathNavigable
}
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

C# 8.0 in a Nutshell

C# 8.0 in a Nutshell

Joseph Albahari, Eric Johannsen
C# 10 in a Nutshell

C# 10 in a Nutshell

Joseph Albahari
C# in a Nutshell, Second Edition

C# in a Nutshell, Second Edition

Peter Drayton, Ben Albahari, Ted Neward
Code like a Pro in C#

Code like a Pro in C#

Jort Rodenburg

Publisher Resources

ISBN: 0596001819Catalog PageErrata