API Reference
Class
HtmlDocumentEngine
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
- 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) #Returns:
HtmlDocumentParses a complete HTML document into an immutable owned snapshot.
Parameters
- source System.String
- options OfficeIMO.Html.Dom.HtmlParseOptions = null
- cancellationToken System.Threading.CancellationToken = default
public HtmlDocumentFragment ParseFragment(String source, HtmlElement contextElement, HtmlParseOptions options = null, CancellationToken cancellationToken = default) #Returns:
HtmlDocumentFragmentParses 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
- contextElement OfficeIMO.Html.Dom.HtmlElement
- options OfficeIMO.Html.Dom.HtmlParseOptions = null
- cancellationToken System.Threading.CancellationToken = default