class DOM_DocumentFragment : public DOM_Node DocumentFragmentis a "lightweight" or "minimal"Documentobject
| | Constructors and assignment operators
| ||||||||
| | Destructor
|
Cloning function.
Destructor.
Equality and Inequality operators.
Functions introduced in DOM Level 2.
null if it is unspecified
null if it is unspecified
Functions to modify the DOM Node.
newChild before the existing child node
refChild
oldChild with newChild
in the list of children, and returns the oldChild node
oldChild from the list
of children, and returns it
newChild to the end of the list of children of
this node
Get functions.
NodeList that contains all children of this node
NamedNodeMap containing the attributes of this node (if it
is an Element) or null otherwise
Document object associated with this node
Query functions.
Set functions.
DocumentFragmentis a "lightweight" or "minimal"Documentobject. 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 aDocumentobject could fulfil this role, aDocumentobject can potentially be a heavyweight object, depending on the underlying implementation. What is really needed for this is a very lightweight object.DocumentFragmentis such an object.Furthermore, various operations -- such as inserting nodes as children of another
Node-- may takeDocumentFragmentobjects as arguments; this results in all the child nodes of theDocumentFragmentbeing moved to the child list of this node.The children of a
DocumentFragmentnode are zero or more nodes representing the tops of any sub-trees defining the structure of the document.DocumentFragmentnodes 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, aDocumentFragmentmight have only one child and that child node could be aTextnode. Such a structure model represents neither an HTML document nor a well-formed XML document.When a
DocumentFragmentis inserted into aDocument(or indeed any otherNodethat may take children) the children of theDocumentFragmentand not theDocumentFragmentitself are inserted into theNode. This makes theDocumentFragmentvery useful when the user wishes to create nodes that are siblings; theDocumentFragmentacts as the parent of these nodes so that the user can use the standard methods from theNodeinterface, such asinsertBefore()andappendChild().
DOM_DocumentFragment. The resulting object does not
refer to an actual Document Fragment node; it will compare == to 0, and is similar
to a null object reference variable in Java. It may subsequently be
assigned to refer to an actual Document Fragment node.
New document fragment nodes are created by DOM_Document::createDocumentFragment().
DOM_DocumentFragment(const DOM_DocumentFragment &other)
DOM_DocumentFragment that refers to the
same underlying node as the original. See also DOM_Node::clone(),
which will copy the actual Document fragment node, rather than just creating a new
reference to the original node.
DOM_DocumentFragment& operator = (const DOM_DocumentFragment &other)
DOM_DocumentFragment& operator = (const DOM_NullPtr *val)
alphabetic index hierarchy of classes
| XML Parser for C++ 2.0 Copyright © IBM Corp, 1999 Center for Java Technology 10275 N. De Anza Blvd. Cupertino CA 95014 USA Email: xml4c@us.ibm.com |
|