Table of Contents

Class XmlDocumentFactory

Namespace
Cuemon.Xml
Assembly
Cuemon.Xml.dll

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

public static class XmlDocumentFactory
Inheritance
Object
XmlDocumentFactory

Methods

CreateDocument(Stream, Boolean)

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

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

Parameters

stream Stream

The System.IO.Stream to convert.

leaveOpen Boolean

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

Returns

XmlDocument

An System.Xml.XmlDocument initialized with the XML provided by stream.

Exceptions

System.ArgumentNullException

stream cannot be null.

CreateDocument(String)

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

public static XmlDocument CreateDocument(string value)

Parameters

value String

The System.String to be convert.

Returns

XmlDocument

An System.Xml.XmlDocument initialized with the XML provided by value.

Exceptions

System.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 System.Xml.XmlDocument from the specified uriLocation.

public static XmlDocument CreateDocument(Uri uriLocation)

Parameters

uriLocation Uri

The System.Uri to convert.

Returns

XmlDocument

An System.Xml.XmlDocument initialized with the XML provided by uriLocation.

Exceptions

System.ArgumentNullException

uriLocation cannot be null.

CreateDocument(XmlReader, Boolean)

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

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

Parameters

reader XmlReader

The System.Xml.XmlReader to convert.

leaveOpen Boolean

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

Returns

XmlDocument

An System.Xml.XmlDocument initialized with the XML provided by reader.

Exceptions

System.ArgumentNullException

reader cannot be null.