XPathDocument Constructor (XmlReader)
Assembly: System.Xml (in system.xml.dll)
An XmlReader object can be used to load a whole XML document into an XPathDocument, or part of an XML document. To load part of an XML document into an XPathDocument, position the XmlReader object on the top XML node to load data from. When you create an XPathDocument using the XPathDocument constructor, data is loaded from the current top node until the top node's closing tag is reached. Data from all child nodes is included.
The following are important notes to consider when you use the XPathDocument constructor.
An XmlReader object with the appropriate associated XmlResolver object settings can be used to resolve entities or other references in XML data.
If the XmlReader object is positioned on a leaf node that is not valid for the root level of a document—for example, a white space or attribute node—the XmlReader object continues to read until it is positioned on a node that can be used for the root. The XPathDocument begins loading at this point.
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.