Class XmlDocument
Represents a xml document that contains the root xml node.
Inheritance
Namespace: FastReport.Utils
Assembly: FastReport.Base.dll
Syntax
public class XmlDocument : IDisposable
Remarks
Use Load and Save methods to load/save the document. To access the root node of the document, use the Root property.
Constructors
XmlDocument()
Initializes a new instance of the XmlDocument class with default settings.
Declaration
public XmlDocument()
Properties
AutoIndent
Gets or sets a value indicating whether is necessary to indent the document when saving it to a file/stream.
Declaration
public bool AutoIndent { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ReadHeader
Gets or sets a value indicating whether is necessary to read xml header.
Declaration
public bool ReadHeader { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Root
Gets the root node of the document.
Declaration
public XmlItem Root { get; }
Property Value
Type | Description |
---|---|
XmlItem |
WriteHeader
Gets or sets a value indicating whether is necessary to add xml header.
Declaration
public bool WriteHeader { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Clear()
Clears the document.
Declaration
public void Clear()
Dispose()
Disposes resources used by the document.
Declaration
public void Dispose()
Load(Stream)
Loads the document from a stream.
Declaration
public void Load(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to load from. |
Load(TextReader)
Declaration
public void Load(TextReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextReader | reader |
Load(String)
Loads the document from a file.
Declaration
public void Load(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The name of file to load from. |
Save(Stream)
Saves the document to a stream.
Declaration
public void Save(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to save to. |
Save(TextWriter)
Saves the document to a string.
Declaration
public void Save(TextWriter textWriter)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextWriter | textWriter | Writer to save to. |
Save(String)
Saves the document to a file.
Declaration
public void Save(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The name of file to save to. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |