API Reference
HtmlNode
An owned node. Parsed snapshots are read-only; edits operate on an independent mutable clone.
Inheritance
- Object
- HtmlNode
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Method HtmlDocument.AppendChild
- Method HtmlDocument.CreateComment
- Method HtmlDocument.CreateFragment
- Method HtmlDocument.CreateTextNode
- Method HtmlDocument.Descendants
- Method HtmlDocument.GetNode
- Method HtmlDocument.GetOrCreateTemplateContent
- Property HtmlDocument.ChildNodes
- Property HtmlDocument.FirstChild
- Property HtmlDocument.NextSibling
- Property HtmlDocument.Parent
- Property HtmlDocument.PreviousSibling
- Method HtmlDocumentType.AppendChild
- Method HtmlDocumentType.Descendants
- Property HtmlDocumentType.ChildNodes
- Property HtmlDocumentType.FirstChild
- Property HtmlDocumentType.NextSibling
- Property HtmlDocumentType.Parent
- Property HtmlDocumentType.PreviousSibling
- Method HtmlElement.AppendChild
- Method HtmlElement.Descendants
- Property HtmlElement.ChildNodes
- Property HtmlElement.FirstChild
- Property HtmlElement.NextSibling
- Property HtmlElement.Parent
- Property HtmlElement.PreviousSibling
- Property HtmlElement.TemplateContent
- Method HtmlNode.AppendChild
- Method HtmlNode.Descendants
- Property HtmlNode.ChildNodes
- Property HtmlNode.FirstChild
- Property HtmlNode.NextSibling
- Property HtmlNode.Parent
- Property HtmlNode.PreviousSibling
Accepted by parameters
- Method HtmlDocument.AppendChild
- Method HtmlDocument.SetSourceIndex
- Method HtmlDocumentType.AppendChild
- Method HtmlElement.AppendChild
- Method HtmlNode.AppendChild
- Method IHtmlDomServices.QuerySelectorAll
- Method IHtmlDomServices.Serialize
Methods
public HtmlNode AppendChild(HtmlNode child) #HtmlNodeAppends or moves a node in the same mutable document. Cycles and cross-document moves are rejected.
Parameters
- child OfficeIMO.Html.Dom.HtmlNode
public IEnumerable<HtmlNode> Descendants() #IEnumerable<HtmlNode>Enumerates descendants in tree order without recursive traversal.
public HtmlElement QuerySelector(String selector) #HtmlElementFinds the first descendant matching a CSS selector.
Parameters
- selector System.String
public IReadOnlyList<HtmlElement> QuerySelectorAll(String selector) #IReadOnlyList<HtmlElement>Finds matching descendants using this document's selector provider.
Parameters
- selector System.String
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public HtmlDocument Document { get; } #Document owning this node, including detached nodes.
public Int32 NodeId { get; } #Stable node identity within this document's edit lineage.
public HtmlNodeKind Kind { get; } #Structural node category.
public HtmlNode Parent { get; set; } #Parent node, or null for the document and detached nodes.
public HtmlElement ParentElement { get; } #Parent element when the immediate parent is an element.
public IReadOnlyList<HtmlNode> ChildNodes { get; } #Ordered child nodes. The collection cannot be mutated directly.
public IEnumerable<HtmlElement> Children { get; } #Direct child elements in source/tree order.
public HtmlNode FirstChild { get; } #First child, if any.
public HtmlNode NextSibling { get; } #Next sibling, if any.
public HtmlNode PreviousSibling { get; } #Previous sibling, if any.
public Nullable<Int32> SourceIndex { get; set; } #Original UTF-16 source offset, or null for an implied or authored node.
public virtual String NodeName { get; } #Node name for non-element nodes; elements expose their local name.
public String TextContent { get; set; } #Text or comment data. Container nodes aggregate descendant text.
public String OuterHtml { get; } #HTML serialization of this node.
public String InnerHtml { get; } #HTML serialization of this node's children.