Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

HtmlDocumentEngine

OfficeIMO.Html

Namespace
OfficeIMO.Html
Assembly
OfficeIMO.Html
Source revision
56dd0d38e0b5 with working tree changes
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

Explore 1 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 1

Constructors

public HtmlDocumentEngine(IHtmlParserProvider parserProvider) #

Creates an engine over a caller-selected parser provider.

Parameters

parserProvider OfficeIMO.Html.Dom.IHtmlParserProvider required

Methods

public HtmlDocument ParseDocument(string source, HtmlParseOptions? options = null, CancellationToken cancellationToken = default) #

Parses a complete HTML document into an immutable owned snapshot.

Parameters

source string required
options OfficeIMO.Html.Dom.HtmlParseOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

HtmlDocument
public HtmlDocumentFragment ParseFragment(string source, HtmlElement contextElement, HtmlParseOptions? options = null, CancellationToken cancellationToken = default) #

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 HtmlDocument.ImportNode before insertion.

Parameters

source string required
contextElement OfficeIMO.Html.Dom.HtmlElement required
options OfficeIMO.Html.Dom.HtmlParseOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

HtmlDocumentFragment

Properties

public static HtmlDocumentEngine Default { get; } #

The default engine shipped by OfficeIMO.Html.

public IHtmlParserProvider ParserProvider { get; } #

The selected inert parser provider.