Class
HtmlDocumentEngine
OfficeIMO.Html
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
- Property HtmlDocumentEngine.Default
Constructors
public HtmlDocumentEngine(IHtmlParserProvider parserProvider) #Creates an engine over a caller-selected parser provider.
Parameters
- parserProvider OfficeIMO.Html.Dom.IHtmlParserProvider
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
- options OfficeIMO.Html.Dom.HtmlParseOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
HtmlDocumentpublic 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
- contextElement OfficeIMO.Html.Dom.HtmlElement
- options OfficeIMO.Html.Dom.HtmlParseOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
HtmlDocumentFragment