Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
The IDOMDocumentFragment object is a lightweight object that is useful for tree insert operations.
Remarks
The IDOMDocumentFragment object can represent a fragment of a document or portion of a document's tree. This makes it useful when implementing end-user commands that allow users to rearrange a document, such as cutting and pasting.
The IDOMDocumentFragment node has special, defined behavior for IDOMNode insert operations that makes it especially convenient for developers. When an IDOMDocumentFragment is inserted into an IDOMDocument node (or other node that can take children), the children of the DocumentFragment are inserted into the node, rather than the DocumentFragment itself. This makes the DocumentFragment useful when the user wants to create nodes that are siblings; the DocumentFragment acts as the parent of these nodes so the user can use the standard methods from the Node interface, such as insertBefore() and appendChild().
The children of a DocumentFragment node are zero or more nodes representing the tops of any subtrees defining the structure of the document. DocumentFragment 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 DocumentFragment might have only one child, and that child node could be a Text node. Such a structure model represents neither an HTML document nor a well-formed XML document.
This object has no unique properties or methods of its own, but exposes the same objects and properties as the IDOMNode object.
Members
See Also
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.