HtmlNode
OfficeIMO.Html.Dom
An owned node. Parsed snapshots are read-only; edits operate on an independent mutable clone.
Inheritance
- object
- HtmlNode
Derived Types
Usage
Explore 48 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 39
- Method HtmlDocument.AppendChild
- Method HtmlDocument.CreateComment
- Method HtmlDocument.CreateTextNode
- Method HtmlDocument.Descendants
- Method HtmlDocument.GetNode
- Method HtmlDocument.ImportNode
- Property HtmlDocument.ChildNodes
- Property HtmlDocument.FirstChild
- Property HtmlDocument.NextSibling
- Property HtmlDocument.Parent
- Property HtmlDocument.PreviousSibling
- Method HtmlDocumentFragment.AppendChild
- Method HtmlDocumentFragment.Descendants
- Property HtmlDocumentFragment.ChildNodes
- Property HtmlDocumentFragment.FirstChild
- Property HtmlDocumentFragment.NextSibling
- Property HtmlDocumentFragment.Parent
- Property HtmlDocumentFragment.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
- Method HtmlNode.AppendChild
- Method HtmlNode.Descendants
- Property HtmlNode.ChildNodes
- Property HtmlNode.FirstChild
- Property HtmlNode.NextSibling
- Property HtmlNode.Parent
- Property HtmlNode.PreviousSibling
Accepted by parameters 9
- Method HtmlDocument.AppendChild
- Method HtmlDocument.ImportNode
- Method HtmlDocument.SetSourceIndex
- Method HtmlDocumentFragment.AppendChild
- Method HtmlDocumentType.AppendChild
- Method HtmlElement.AppendChild
- Method HtmlNode.AppendChild
- Method IHtmlDomServices.QuerySelectorAll
- Method IHtmlDomServices.Serialize
Methods
public HtmlNode AppendChild(HtmlNode child) #Appends or moves a node in the same mutable document. Cycles and cross-document moves are rejected.
Parameters
- child OfficeIMO.Html.Dom.HtmlNode
Returns
HtmlNodepublic IEnumerable<HtmlNode> Descendants() #Enumerates descendants in tree order without recursive traversal.
Returns
IEnumerable<HtmlNode>public HtmlElement? QuerySelector(string selector) #Finds the first descendant matching a CSS selector.
Parameters
- selector string
Returns
HtmlElement?public IReadOnlyList<HtmlElement> QuerySelectorAll(string selector) #Finds matching descendants using this document's selector provider.
Parameters
- selector string
Returns
IReadOnlyList<HtmlElement>Inherited Methods
Properties
public HtmlDocument Document { get; } #Document owning this node, including detached nodes.
public HtmlNode? Parent { get; private 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 int? SourceIndex { get; internal 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.