Interface INode
Abstraction for a DOM node.
Inherited Members
Namespace: ZptSharp.Dom
Assembly: ZptSharp.Abstractions.dll
Syntax
public interface INode : IHasDocumentSourceInfo, IHasNodes
Properties
| Improve this Doc View SourceAttributes
Gets a collection of the node's attributes.
Declaration
IList<IAttribute> Attributes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<IAttribute> | The attributes. |
ChildNodes
Gets the children contained within the current node.
Declaration
IList<INode> ChildNodes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<INode> | The child nodes. |
Document
Gets the parent document for the current node.
Declaration
IDocument Document { get; }
Property Value
Type | Description |
---|---|
IDocument | The document. |
IsElement
Gets a value indicating whether this INode is an element node.
Declaration
bool IsElement { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsImported
Gets a value indicating whether this INode is imported. A node is imported if its associated Document differs from the document upon its ParentNode.
Declaration
bool IsImported { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ParentNode
Gets or sets the parent for the current node. This will be a null reference if the current instance is the root node of the document or if the node is not attached to a DOM.
Declaration
INode ParentNode { get; set; }
Property Value
Type | Description |
---|---|
INode | The parent node. |
PreReplacementSourceInfo
Gets or sets information about the source of the node (for example, a file path and line number) before it was replaced. For most nodes this will be null, but when the current node is a replacement (such as METAL macro usage), this property will contain source information for the replaced node.
Declaration
NodeSourceInfo PreReplacementSourceInfo { get; set; }
Property Value
Type | Description |
---|---|
NodeSourceInfo | The pre-replacement source info. |
SourceInfo
Gets information which indicates the original source of the node (for example, a file path and line number).
Declaration
NodeSourceInfo SourceInfo { get; }
Property Value
Type | Description |
---|---|
NodeSourceInfo | The source info. |
Methods
| Improve this Doc View SourceCreateAttribute(AttributeSpec)
Creates and returns a new attribute from the specified specification.
Declaration
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. |
CreateComment(String)
Creates and returns a new comment node.
Declaration
INode CreateComment(string commentText)
Parameters
Type | Name | Description |
---|---|---|
System.String | commentText | The text for the comment. |
Returns
Type | Description |
---|---|
INode | The comment node. |
CreateTextNode(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
INode CreateTextNode(string content)
Parameters
Type | Name | Description |
---|---|---|
System.String | content | The text content for the node. |
Returns
Type | Description |
---|---|
INode | A text node. |
GetCopy()
Gets a copy of the current node and all of its children.
Declaration
INode GetCopy()
Returns
Type | Description |
---|---|
INode | The copied node. |
IsInNamespace(Namespace)
Gets a value which indicates whether or not the current node is in the specified namespace.
Declaration
bool IsInNamespace(Namespace namespace)
Parameters
Type | Name | Description |
---|---|---|
Namespace | namespace | A namespace. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ParseAsNodes(String)
Parses the specified text markup
and returns the resulting nodes.
Declaration
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. |