| 
 DOMDocumentFragment Class ReferenceDOMDocumentFragment is a "lightweight" or "minimal" DOMDocument object.  
More...
Inheritance diagram for DOMDocumentFragment:  [legend]List of all members. 
 Detailed DescriptionDOMDocumentFragment is a "lightweight" or "minimal" DOMDocument 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 DOMNode for this purpose. While it is true that a DOMDocumentobject could fulfil this role, aDOMDocumentobject can potentially be a heavyweight object, depending on the underlying implementation. What is really needed for this is a very lightweight object.DOMDocumentFragmentis such an object. 
Furthermore, various operations -- such as inserting nodes as children of another DOMNode-- may takeDOMDocumentFragmentobjects as arguments; this results in all the child nodes of theDOMDocumentFragmentbeing moved to the child list of this node. 
The children of a DOMDocumentFragmentnode are zero or more nodes representing the tops of any sub-trees defining the structure of the document.DOMDocumentFragmentnodes 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, aDOMDocumentFragmentmight have only one child and that child node could be aDOMTextnode. Such a structure model represents neither an HTML document nor a well-formed XML document. 
When a DOMDocumentFragmentis inserted into aDOMDocument(or indeed any otherDOMNodethat may take children) the children of theDOMDocumentFragmentand not theDOMDocumentFragmentitself are inserted into theDOMNode. This makes theDOMDocumentFragmentvery useful when the user wishes to create nodes that are siblings; theDOMDocumentFragmentacts as the parent of these nodes so that the user can use the standard methods from theDOMNodeinterface, such asinsertBefore()andappendChild(). 
 Since:DOM Level 1 
 
 
 Constructor & Destructor Documentation
 
  
    | 
        
          | DOMDocumentFragment::DOMDocumentFragment | ( |  | ) |  [protected] |  |  
 The documentation for this class was generated from the following file:
 |