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
StreamThe Stream to convert.
leaveOpen
Booleanif
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
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
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
XmlReaderThe XmlReader to convert.
leaveOpen
Booleanif
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.