# HtmlDocumentFragment

An owned document fragment. A fragment can retain multiple top-level nodes and splices its children when appended to an element or document.

Class 

`OfficeIMO.Html.Dom`

**Namespace**

`OfficeIMO.Html.Dom`

**Assembly**

`OfficeIMO.Html.Core`

**Source revision**

`56dd0d38e0b5` with working tree changes

**Source**

[HtmlDocumentFragment.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlDocumentFragment.cs#L7)

**Base**

`HtmlNode`

**Modifiers**

sealed

An owned document fragment. A fragment can retain multiple top-level nodes and splices its children when appended to an element or document.

## Inheritance

- [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)
- HtmlDocumentFragment

## Usage

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

- Method [HtmlDocument.CreateFragment](/api/html-core/officeimo-html-dom-htmldocument/#method-createfragment)
- Method [HtmlDocument.GetOrCreateTemplateContent](/api/html-core/officeimo-html-dom-htmldocument/#method-getorcreatetemplatecontent-officeimo-html-dom-htmlelement)
- Property [HtmlElement.TemplateContent](/api/html-core/officeimo-html-dom-htmlelement/#property-templatecontent)
- Method [IHtmlParserProvider.ParseFragment](/api/html-core/officeimo-html-dom-ihtmlparserprovider/#method-parsefragment-string-officeimo-html-dom-htmlelement-officeimo-html-dom-htmlparseoptions-threading-cancellationtoken)

Filter members 

Show inherited

## Inherited Methods

`public HtmlNode AppendChild(HtmlNode child)` [#](#method-appendchild-htmlnode)

[HtmlNode.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L74)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

Parameters

**child HtmlNode required**

Returns

`HtmlNode`

`public IEnumerable<HtmlNode> Descendants()` [#](#method-descendants)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

Returns

`IEnumerable<HtmlNode>`

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public HtmlElement? QuerySelector(string selector)` [#](#method-queryselector-string)

[HtmlNode.cs:122](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L122)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

Parameters

**selector string required**

Returns

`HtmlElement?`

`public IReadOnlyList<HtmlElement> QuerySelectorAll(string selector)` [#](#method-queryselectorall-string)

[HtmlNode.cs:125](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L125)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

Parameters

**selector string required**

Returns

`IReadOnlyList<HtmlElement>`

`public void Remove()` [#](#method-remove)

[HtmlNode.cs:103](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L103)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Inherited Properties

`public HtmlDocument Document { get; }` [#](#property-document)

[HtmlNode.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L22)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public int NodeId { get; }` [#](#property-nodeid)

[HtmlNode.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L24)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public HtmlNodeKind Kind { get; }` [#](#property-kind)

[HtmlNode.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L26)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public HtmlNode? Parent { get; }` [#](#property-parent)

[HtmlNode.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L28)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public HtmlElement? ParentElement { get; }` [#](#property-parentelement)

[HtmlNode.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L31)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public IReadOnlyList<HtmlNode> ChildNodes { get; }` [#](#property-childnodes)

[HtmlNode.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L33)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public IEnumerable<HtmlElement> Children { get; }` [#](#property-children)

[HtmlNode.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L35)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public HtmlNode? FirstChild { get; }` [#](#property-firstchild)

[HtmlNode.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L37)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public HtmlNode? NextSibling { get; }` [#](#property-nextsibling)

[HtmlNode.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L39)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public HtmlNode? PreviousSibling { get; }` [#](#property-previoussibling)

[HtmlNode.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L41)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public int? SourceIndex { get; internal set; }` [#](#property-sourceindex)

[HtmlNode.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L43)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public virtual string NodeName { get; }` [#](#property-nodename)

[HtmlNode.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L45)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public string TextContent { get; set; }` [#](#property-textcontent)

[HtmlNode.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L49)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public string OuterHtml { get; }` [#](#property-outerhtml)

[HtmlNode.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L68)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

`public string InnerHtml { get; }` [#](#property-innerhtml)

[HtmlNode.cs:70](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.Html.Core/HtmlNode.cs#L70)

Inherited from [HtmlNode](/api/html-core/officeimo-html-dom-htmlnode/)

<!-- PowerForge markdown artifact sha256:0E47EB25DB908613C7835A50E8F4D7D3BDDACFFEFB7E715C54DAD2AB81A644F0 -->
