Class XmlDocumentFactory
Provides access to factory methods for creating and configuring XmlDocument instances.
public static class XmlDocumentFactory
- Inheritance
-
XmlDocumentFactory
Methods
CreateDocument(Stream, bool)
Creates and returns an instance of XmlDocument from the specified stream.
public static XmlDocument CreateDocument(Stream stream, bool leaveOpen = false)
Parameters
streamStreamThe Stream to convert.
leaveOpenboolif
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
streamcannot 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
valuecannot be null.- ArgumentException
valuecannot 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
uriLocationcannot be null.
CreateDocument(XmlReader, bool)
Creates and returns an instance of XmlDocument from the specified reader.
public static XmlDocument CreateDocument(XmlReader reader, bool leaveOpen = false)
Parameters
readerXmlReaderThe XmlReader to convert.
leaveOpenboolif
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
readercannot be null.