# IHtmlParserProvider

Parses inert HTML into an owned document. Implementations must perform no resource loading or script execution.

Interface 

`OfficeIMO.Html.Dom`

**Namespace**

`OfficeIMO.Html.Dom`

**Assembly**

`OfficeIMO.Html.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[HtmlDomProviders.cs:4](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Html.Core/HtmlDomProviders.cs#L4)

**Modifiers**

abstract

Parses inert HTML into an owned document. Implementations must perform no resource loading or script execution.

Filter members 

Show inherited

## Methods

`public abstract HtmlDocument ParseDocument(string source, HtmlParseOptions options, CancellationToken cancellationToken = default)` [#](#method-parsedocument-string-officeimo-html-dom-htmlparseoptions-threading-cancellationtoken)

Parses a complete document and returns an immutable snapshot.

Parameters

**source string required**

**options OfficeIMO.Html.Dom.HtmlParseOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`HtmlDocument`

`public abstract HtmlDocumentFragment ParseFragment(string source, HtmlElement contextElement, HtmlParseOptions options, CancellationToken cancellationToken = default)` [#](#method-parsefragment-string-officeimo-html-dom-htmlelement-officeimo-html-dom-htmlparseoptions-threading-cancellationtoken)

Parses source with the supplied element as the HTML fragment-parsing context. The returned fragment belongs to an independent owned document and can be inserted with [HtmlDocument.ImportNode](/api/html-core/officeimo-html-dom-htmldocument/).

Parameters

**source string required**

**contextElement OfficeIMO.Html.Dom.HtmlElement required**

**options OfficeIMO.Html.Dom.HtmlParseOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`HtmlDocumentFragment`

## Properties

`public abstract string Id { get; }` [#](#property-id)

Identifies the parser implementation for diagnostics and reproducibility.

<!-- PowerForge markdown artifact sha256:B5B74AFD08012328BD0E6FD3E8160087F9D3DCEA651772DD10AFC06412FBCE7C -->
