Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

HtmlNode

Namespace OfficeIMO.Html.Dom
Assembly OfficeIMO.Html.Core

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.

Accepted by parameters

Methods

public HtmlNode AppendChild(HtmlNode child) #
Returns: HtmlNode

Appends or moves a node in the same mutable document. Cycles and cross-document moves are rejected.

Parameters

child OfficeIMO.Html.Dom.HtmlNode requiredposition: 0
public IEnumerable<HtmlNode> Descendants() #
Returns: IEnumerable<HtmlNode>

Enumerates descendants in tree order without recursive traversal.

public HtmlElement QuerySelector(String selector) #
Returns: HtmlElement

Finds the first descendant matching a CSS selector.

Parameters

selector System.String requiredposition: 0
public IReadOnlyList<HtmlElement> QuerySelectorAll(String selector) #
Returns: IReadOnlyList<HtmlElement>

Finds matching descendants using this document's selector provider.

Parameters

selector System.String requiredposition: 0
public Void Remove() #
Returns: Void

Detaches this node without affecting sibling nodes.

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.