Class XPathDocumentFactory
Provides access to factory methods for creating and configuring IXPathNavigable instances.
public static class XPathDocumentFactory
- Inheritance
-
XPathDocumentFactory
Methods
CreateDocument(Stream, bool)
Creates and returns an instance of XPathDocument from the specified stream.
public static XPathDocument CreateDocument(Stream stream, bool leaveOpen = false)
Parameters
streamStreamThe Stream to convert.
leaveOpenboolif
true, the source Stream is being left open; otherwise it is being closed and disposed.
Returns
- XPathDocument
An XPathDocument initialized with the XML provided by
stream.
Exceptions
- ArgumentNullException
streamcannot be null.
CreateDocument(string)
Creates and returns an instance of XPathDocument from the specified value.
public static XPathDocument CreateDocument(string value)
Parameters
Returns
- XPathDocument
An XPathDocument initialized with the XML provided by
value.
Exceptions
- ArgumentNullException
valuecannot be null.
CreateDocument(string, Encoding)
Creates and returns an instance of XPathDocument from the specified value.
public static XPathDocument CreateDocument(string value, Encoding encoding)
Parameters
valuestringThe string to convert.
encodingEncodingThe preferred Encoding to use in the conversion.
Returns
- XPathDocument
An XPathDocument initialized with the XML provided by
value.
Exceptions
- ArgumentNullException
valuecannot be null -or-encodingcannot be null.
CreateDocument(Uri)
Creates and returns an instance of XPathDocument from the specified uriLocation.
public static XPathDocument CreateDocument(Uri uriLocation)
Parameters
Returns
- XPathDocument
An XPathDocument initialized with the XML provided by
uriLocation.
Exceptions
- ArgumentNullException
uriLocationcannot be null.
CreateDocument(XmlReader)
Creates and returns an instance of XPathDocument from the specified reader.
public static XPathDocument CreateDocument(XmlReader reader)
Parameters
Returns
- XPathDocument
An XPathDocument initialized with the XML provided by
reader.
Exceptions
- ArgumentNullException
readercannot be null.