Class XmlNode
Implementation of INode which is based upon an XML System.Xml.Linq.XNode.
Inherited Members
Namespace: ZptSharp.Dom
Assembly: ZptSharp.Xml.dll
Syntax
public class XmlNode : NodeBase, INode, IHasDocumentSourceInfo, IHasNodes
Constructors
| Improve this Doc View SourceXmlNode(XNode, XmlDocument, INode, NodeSourceInfo)
Initializes a new instance of the XmlNode class.
Declaration
public XmlNode(XNode node, XmlDocument document, INode parent = null, NodeSourceInfo sourceInfo = null)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.Linq.XNode | node | The native node object. |
XmlDocument | document | The containing document. |
INode | parent | The parent node. |
NodeSourceInfo | sourceInfo | Source info. |
Properties
| Improve this Doc View SourceAttributes
Gets a collection of the node's attributes.
Declaration
public override IList<IAttribute> Attributes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<IAttribute> | The attributes. |
Overrides
| Improve this Doc View SourceChildNodes
Gets the nodes contained within the current node.
Declaration
public override IList<INode> ChildNodes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<INode> | The child nodes. |
Overrides
| Improve this Doc View SourceElementNode
Gets a representation of NativeNode as an System.Xml.Linq.XElement, if it is in fact an element node.
Declaration
protected XElement ElementNode { get; }
Property Value
Type | Description |
---|---|
System.Xml.Linq.XElement | The element node. |
IsElement
Gets a value indicating whether this INode is an element node.
Declaration
public override bool IsElement { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Overrides
| Improve this Doc View SourceNativeNode
Gets the native XML System.Xml.Linq.XNode instance which acts as the basis for the current node.
Declaration
public XNode NativeNode { get; }
Property Value
Type | Description |
---|---|
System.Xml.Linq.XNode | The native XML node object. |
Methods
| Improve this Doc View SourceCreateAttribute(AttributeSpec)
Creates and returns a new attribute from the specified specification.
Declaration
public override IAttribute CreateAttribute(AttributeSpec spec)
Parameters
Type | Name | Description |
---|---|---|
AttributeSpec | spec | The attribute specification which will be used to name the attribute. |
Returns
Type | Description |
---|---|
IAttribute | An attribute. |
Overrides
| Improve this Doc View SourceCreateComment(String)
Creates and returns a new comment node.
Declaration
public override INode CreateComment(string commentText)
Parameters
Type | Name | Description |
---|---|---|
System.String | commentText | The text for the comment. |
Returns
Type | Description |
---|---|
INode | The comment node. |
Overrides
| Improve this Doc View SourceCreateTextNode(String)
Creates and returns a new text node from the specified content. Even if the content contains valid markup, it is strictly to be treated as text.
Declaration
public override INode CreateTextNode(string content)
Parameters
Type | Name | Description |
---|---|---|
System.String | content | The text content for the node. |
Returns
Type | Description |
---|---|
INode | A text node. |
Overrides
| Improve this Doc View SourceGetCopy()
Gets a copy of the current node and all of its children.
Declaration
public override INode GetCopy()
Returns
Type | Description |
---|---|
INode | The copied node. |
Overrides
| Improve this Doc View SourceIsInNamespace(Namespace)
Gets a value which indicates whether or not the current node is in the specified namespace.
Declaration
public override bool IsInNamespace(Namespace namespace)
Parameters
Type | Name | Description |
---|---|---|
Namespace | namespace | A namespace. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
| Improve this Doc View SourceParseAsNodes(String)
Parses the specified text markup
and returns the resulting nodes.
Declaration
public override IList<INode> ParseAsNodes(string markup)
Parameters
Type | Name | Description |
---|---|---|
System.String | markup | Markup text. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<INode> | The parsed nodes. |
Overrides
| Improve this Doc View SourceToString()
Returns a System.String that represents the current XmlNode. If it is an element node then this method shows the element's start-tag. Otherwise it returns the same as the native System.Xml.Linq.XNode's System.Object.ToString() method.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that represents the current XmlNode. |