Table of Contents

Class XmlDocumentFactory

Namespace
Cuemon.Xml
Assembly
Cuemon.Xml.dll

Provides access to factory methods for creating and configuring XmlDocument instances.

public static class XmlDocumentFactory
Inheritance
XmlDocumentFactory

Methods

CreateDocument(Stream, Boolean)

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

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

Parameters

stream Stream

The Stream to convert.

leaveOpen Boolean

if true, the Stream object is being left open; otherwise it is being closed and disposed.

Returns

XmlDocument

An XmlDocument initialized with the XML provided by stream.

Exceptions

ArgumentNullException

stream cannot be null.

CreateDocument(String)

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

public static XmlDocument CreateDocument(string value)

Parameters

value String

The String to be convert.

Returns

XmlDocument

An XmlDocument initialized with the XML provided by value.

Exceptions

ArgumentNullException

value cannot be null.

ArgumentException

value cannot be empty or consist only of white-space characters.

CreateDocument(Uri)

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

public static XmlDocument CreateDocument(Uri uriLocation)

Parameters

uriLocation Uri

The Uri to convert.

Returns

XmlDocument

An XmlDocument initialized with the XML provided by uriLocation.

Exceptions

ArgumentNullException

uriLocation cannot be null.

CreateDocument(XmlReader, Boolean)

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

public static XmlDocument CreateDocument(XmlReader reader, bool leaveOpen = false)

Parameters

reader XmlReader

The XmlReader to convert.

leaveOpen Boolean

if true, the XmlReader object is being left open; otherwise it is being closed and disposed.

Returns

XmlDocument

An XmlDocument initialized with the XML provided by reader.

Exceptions

ArgumentNullException

reader cannot be null.