Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

HtmlDocumentEngine

Namespace OfficeIMO.Html
Assembly OfficeIMO.Html
Modifiers sealed

Provider-neutral front door for inert HTML document and contextual-fragment parsing. Returned trees are owned by OfficeIMO and do not expose provider nodes.

Inheritance

  • Object
  • HtmlDocumentEngine

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

Constructors

public HtmlDocumentEngine(IHtmlParserProvider parserProvider) #

Creates an engine over a caller-selected parser provider.

Parameters

parserProvider OfficeIMO.Html.Dom.IHtmlParserProvider requiredposition: 0

Methods

public HtmlDocument ParseDocument(String source, HtmlParseOptions options = null, CancellationToken cancellationToken = default) #
Returns: HtmlDocument

Parses a complete HTML document into an immutable owned snapshot.

Parameters

source System.String requiredposition: 0
options OfficeIMO.Html.Dom.HtmlParseOptions = null optionalposition: 1
cancellationToken System.Threading.CancellationToken = default optionalposition: 2
public HtmlDocumentFragment ParseFragment(String source, HtmlElement contextElement, HtmlParseOptions options = null, CancellationToken cancellationToken = default) #
Returns: HtmlDocumentFragment

Parses source using an owned element and its ancestors as the HTML fragment context. The result belongs to an independent immutable document. Import it into a mutable target document with CancellationToken) before insertion.

Parameters

source System.String requiredposition: 0
contextElement OfficeIMO.Html.Dom.HtmlElement requiredposition: 1
options OfficeIMO.Html.Dom.HtmlParseOptions = null optionalposition: 2
cancellationToken System.Threading.CancellationToken = default optionalposition: 3

Properties

public static HtmlDocumentEngine Default { get; } #

The default engine shipped by OfficeIMO.Html.

public IHtmlParserProvider ParserProvider { get; } #

The selected inert parser provider.