Table of Contents

CreateDocument Method

Definition

Namespace
Cuemon.Xml.XPath
Assemblies
Cuemon.Xml.dll
Source
src/Cuemon.Xml/XPath/XPathDocumentFactory.cs

CreateDocument(string)

Creates and returns an instance of XPathDocument from the specified value.

public static XPathDocument CreateDocument(string value)

Parameters

value string

The string to convert.

Returns

XPathDocument

An XPathDocument initialized with the XML provided by value.

Exceptions

ArgumentNullException

value cannot 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

value string

The string to convert.

encoding Encoding

The preferred Encoding to use in the conversion.

Returns

XPathDocument

An XPathDocument initialized with the XML provided by value.

Exceptions

ArgumentNullException

value cannot be null -or- encoding cannot be null.

CreateDocument(Stream, bool)

Creates and returns an instance of XPathDocument from the specified stream.

public static XPathDocument CreateDocument(Stream stream, bool leaveOpen = false)

Parameters

stream Stream

The Stream to convert.

leaveOpen bool

if 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

stream cannot be null.

CreateDocument(XmlReader)

Creates and returns an instance of XPathDocument from the specified reader.

public static XPathDocument CreateDocument(XmlReader reader)

Parameters

reader XmlReader

The XmlReader to convert.

Returns

XPathDocument

An XPathDocument initialized with the XML provided by reader.

Exceptions

ArgumentNullException

reader cannot be null.

CreateDocument(Uri)

Creates and returns an instance of XPathDocument from the specified uriLocation.

public static XPathDocument CreateDocument(Uri uriLocation)

Parameters

uriLocation Uri

The Uri to convert.

Returns

XPathDocument

An XPathDocument initialized with the XML provided by uriLocation.

Exceptions

ArgumentNullException

uriLocation cannot be null.