AngleSharp by Florian Rappl

<PackageReference Include="AngleSharp" Version="0.2.2" />

 Node

public class Node : INode
Represents a node in the generated tree.

protected string _baseURI

protected NodeList _children

protected string _name

protected string _ns

protected Document _owner

protected Node _parent

public NamedNodeMap Attributes { get; }

Gets the attributes for this node.

public string BaseURI { get; }

Gets or sets the absolute base URI of a node or null if unable to obtain an absolute URI.

public NodeList ChildNodes { get; }

Gets the children of this node.

public Node FirstChild { get; }

Gets the first child node of this node.

public bool HasAttributes { get; }

Gets a boolean value indicating whether the current Node has attribute nodes or not.

public bool HasChildNodes { get; }

Gets a boolean value indicating whether the current Node has child nodes or not.

public Node LastChild { get; }

Gets the last child node of this node.

public string LocalName { get; }

Gets the local part of the qualified name of this node.

public string NamespaceURI { get; set; }

Gets or sets the namespace URI of this node.

public Node NextSibling { get; }

Gets the node immediately following this node's parent's list of nodes, or null if the current node is the last node in that list.

public string NodeName { get; }

Gets the tag name for this node.

public NodeType NodeType { get; protected set; }

Gets the type of this node.

public virtual string NodeValue { get; set; }

Gets or sets the value of the current node.

public Document OwnerDocument { get; }

Gets the owner document of the node.

public Element ParentElement { get; }

Gets or sets the parent element of this node.

public Node ParentNode { get; }

Gets the parent node of this node, which is either an Element node, a Document node, or a DocumentFragment node.

public string Prefix { get; }

Gets the namespace prefix of the specified node, or null if no prefix is specified.

public Node PreviousSibling { get; }

Gets the node immediately preceding this node's parent's list of nodes, null if the specified node is the first in that list.

public virtual string TextContent { get; set; }

Gets or sets the text content of a node and its descendants.

public Node()

Constructs a new node.

protected static void CopyProperties(Node source, Node target, bool deep)

Copies all (Node) properties of the source to the target.

protected static bool IsValidNamespaceDeclaration(string namespaceName, string namespaceURI)

Checks if the given namespace name and URI are valid.

public virtual Node AppendChild(Node child)

Adds a child to the collection of children.

public virtual Node CloneNode(bool deep = true)

Returns a duplicate of the node on which this method was called.

public virtual DocumentPosition CompareDocumentPosition(Node otherNode)

Compares the position of the current node against another node in any other document.

public virtual bool Contains(Node otherNode)

Indicates whether a node is a descendent of this node.

public virtual Node InsertBefore(Node newElement, Node referenceElement)

Inserts the specified node before a reference element as a child of the current node.

public virtual Node InsertChild(int index, Node child)

Inserts a child to the collection of children at the specified index.

public virtual bool IsDefaultNamespace(string namespaceURI)

Accepts a namespace URI as an argument and returns true if the namespace is the default namespace on the given node or false if not.

public virtual bool IsEqualNode(Node otherNode)

Tests whether two nodes are equal.

protected string LookupNamespacePrefix(string namespaceURI, Element originalElement)

Returns the prefix for a given namespaceURI if present, and null if not. When multiple prefixes are possible, the result is implementation-dependent.

public virtual string LookupNamespaceURI(string prefix)

Takes a prefix and returns the namespaceURI associated with it on the given node if found (and null if not). Supplying null for the prefix will return the default namespace.

public virtual string LookupPrefix(string namespaceURI)

Returns the prefix for a given namespaceURI if present, and null if not. When multiple prefixes are possible, the result is implementation-dependent.

protected Node MutationMacro(Node[] nodes)

Runs the mutation macro as defined in 5.2.2 Mutation methods of http://www.w3.org/TR/domcore/.

public virtual Node Normalize()

Puts the specified node and all of its subtree into a "normalized" form. In a normalized subtree, no text nodes in the subtree are empty and there are no adjacent text nodes.

public virtual Node RemoveChild(Node child)

Removes a child from the collection of children.

public virtual Node ReplaceChild(Node newChild, Node oldChild)

Replaces one child node of the specified element with another.

public virtual string ToHtml()

Returns an HTML-code representation of the node.

public string ToTree(int indent = 0)

Returns a (string) tree representation of the node and all sub-nodes.