Show / Hide Table of Contents

Interface INode

Abstraction for a DOM node.

Inherited Members
IHasNodes.GetChildNodes()
Namespace: ZptSharp.Dom
Assembly: ZptSharp.Abstractions.dll
Syntax
public interface INode : IHasDocumentSourceInfo, IHasNodes

Properties

| Improve this Doc View Source

Attributes

Gets a collection of the node's attributes.

Declaration
IList<IAttribute> Attributes { get; }
Property Value
Type Description
System.Collections.Generic.IList<IAttribute>

The attributes.

| Improve this Doc View Source

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.

| Improve this Doc View Source

Document

Gets the parent document for the current node.

Declaration
IDocument Document { get; }
Property Value
Type Description
IDocument

The document.

| Improve this Doc View Source

IsElement

Gets a value indicating whether this INode is an element node.

Declaration
bool IsElement { get; }
Property Value
Type Description
System.Boolean

true if the current instance is an element; otherwise, false.

| Improve this Doc View Source

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

true if this node is imported; otherwise, false.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 Source

CreateAttribute(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

GetCopy()

Gets a copy of the current node and all of its children.

Declaration
INode GetCopy()
Returns
Type Description
INode

The copied node.

| Improve this Doc View Source

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

true, if the node is in the specified namespace, false otherwise.

| Improve this Doc View Source

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.

Extension Methods

NodeExtensions.GetMatchingAttribute(INode, AttributeSpec)
NodeExtensions.GetMatchingAttribute(INode, IEnumerable<AttributeSpec>, out AttributeSpec)
NodeExtensions.AddChildren(INode, IEnumerable<INode>, Nullable<Int32>)
NodeExtensions.AddChildren(INode, IList<INode>, Nullable<Int32>)
NodeExtensions.Remove(INode)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX