Class XmlDocument
An implementation of IDocument which is based upon
a System.Xml.Linq
System.Xml.Linq.XDocument.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ZptSharp.Dom
Assembly: ZptSharp.Xml.dll
Syntax
public class XmlDocument : DocumentBase, IDocument, IHasDocumentSourceInfo, IHasNodes, ICanReplaceRootNode
Constructors
| Improve this Doc View SourceXmlDocument(XDocument, IDocumentSourceInfo)
Initializes a new instance of the XmlDocument class.
Declaration
public XmlDocument(XDocument document, IDocumentSourceInfo source)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.Linq.XDocument | document | The native XML document. |
IDocumentSourceInfo | source | The source info for the document. |
Properties
| Improve this Doc View SourceNativeDocument
Gets the native HTML Agility Pack document object.
Declaration
public XDocument NativeDocument { get; }
Property Value
Type | Description |
---|---|
System.Xml.Linq.XDocument | The native document. |
RootNode
Gets the root element for the current document.
Declaration
public override INode RootNode { get; }
Property Value
Type | Description |
---|---|
INode | The root node. |
Overrides
Methods
| Improve this Doc View SourceAddCommentToBeginningOfDocument(String)
Where-supported, adds a comment before the first element node in the document. In cases where the underlying document implementation does not support this, a workaround is acceptable (such as commenting immediately inside the first node).
Declaration
public override void AddCommentToBeginningOfDocument(string commentText)
Parameters
Type | Name | Description |
---|---|---|
System.String | commentText |
Overrides
| Improve this Doc View SourceReplaceRootNode(INode)
Replaces the root element node of the DOM using the specified replacement
.
Declaration
public void ReplaceRootNode(INode replacement)
Parameters
Type | Name | Description |
---|---|---|
INode | replacement | The replacement node. |