IDocumentFragment
Interface
csharp
DocumentFragment
<pre><code class="lang-csharp">Document</code></pre> object. It is very common to want to be able to
extract a portion of a document's tree or to create a new fragment of a
document. Imagine implementing a user command like cut or rearranging a
document by moving fragments around. It is desirable to have an object
which can hold such fragments and it is quite natural to use a Node for
this purpose. While it is true that a <pre><code class="lang-csharp">Document</code></pre> object could
fulfill this role, a <pre><code class="lang-csharp">Document</code></pre> object can potentially be a
heavyweight object, depending on the underlying implementation. What is
really needed for this is a very lightweight object.
<pre><code class="lang-csharp">DocumentFragment</code></pre> is such an object.
<p>Furthermore, various operations -- such as inserting nodes as children
of another <pre><code class="lang-csharp">Node</code></pre> -- may take <pre><code class="lang-csharp">DocumentFragment</code></pre>
objects as arguments; this results in all the child nodes of the
<pre><code class="lang-csharp">DocumentFragment</code></pre> being moved to the child list of this node.</p><p>The children of a <pre><code class="lang-csharp">DocumentFragment</code></pre> node are zero or more
nodes representing the tops of any sub-trees defining the structure of
the document. <pre><code class="lang-csharp">DocumentFragment</code></pre> nodes do not need to be
well-formed XML documents (although they do need to follow the rules
imposed upon well-formed XML parsed entities, which can have multiple top
nodes). For example, a <pre><code class="lang-csharp">DocumentFragment</code></pre> might have only one
child and that child node could be a <pre><code class="lang-csharp">Text</code></pre> node. Such a
structure model represents neither an HTML document nor a well-formed XML
document.</p><p>When a <pre><code class="lang-csharp">DocumentFragment</code></pre> is inserted into a
<pre><code class="lang-csharp">Document</code></pre> (or indeed any other <pre><code class="lang-csharp">Node</code></pre> that may
take children) the children of the <pre><code class="lang-csharp">DocumentFragment</code></pre> and not
the <pre><code class="lang-csharp">DocumentFragment</code></pre> itself are inserted into the
<pre><code class="lang-csharp">Node</code></pre>. This makes the <pre><code class="lang-csharp">DocumentFragment</code></pre> very
useful when the user wishes to create nodes that are siblings; the
<pre><code class="lang-csharp">DocumentFragment</code></pre> acts as the parent of these nodes so that
the user can use the standard methods from the <pre><code class="lang-csharp">Node</code></pre>
interface, such as <pre><code class="lang-csharp">insertBefore</code></pre> and <pre><code class="lang-csharp">appendChild</code></pre>.</p><p>See also the <a href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113">Document Object Model (DOM) Level 2 Core Specification</a>.</p>
Definition
Namespace:Telerik.WinForms.Documents.FormatProviders.Html.Parsing.Dom
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
C#
public interface IDocumentFragment : INode
Inherited Members