Click to return to the XML (Extensible Markup Language) home page    
IXMLDOMDocument Interface     IXMLDOMDocumentType Inter...     XML DOM Interfaces    
Web Workshop  |  XML (Extensible Markup Language)

IXMLDOMDocumentFragment Interface


A DocumentFragment is a lightweight object that is useful for tree insert operations.

IXMLDOMDocumentFragment Methods

This interface has no unique methods of its own, but exposes the inherited methods from the IXMLDOMNode interface.

Remarks

A DocumentFragment 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 DocumentFragment node has a special defined behavior for IXMLDOMNode insert operations that makes it especially convenient for developers. When a DocumentFragment is inserted into a document (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 that 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.

Interface Information

Implementation Msxml.dll
Inherits from IXMLDOMNode
Header and IDL files Msxml.h, Xmldom.idl
Minimum availability Internet Explorer 5
Minimum operating systems Windows 95, Windows NT 4.0


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.