All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

XMLParser Interface CATIDOMDocumentFragment

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---XMLParser.CATIDOMNode
        |
        +---CATIDOMDocumentFragment
 

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATIDOMDocumentFragment

Interface representing a "lightweight" or "minimal" CATIDOMDocument 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 CATIDOMNode for this purpose. While it is true that a CATIDOMDocument object could fulfil this role, a CATIDOMDocument object can potentially be a heavyweight object, depending on the underlying implementation. What is really needed for this is a very lightweight object. CATIDOMDocumentFragment is such an object.

Furthermore, various operations -- such as inserting nodes as children of another CATIDOMNode -- may take CATIDOMDocumentFragment objects as arguments; this results in all the child nodes of the CATIDOMDocumentFragment being moved to the child list of this node.

The children of a CATIDOMDocumentFragment node are zero or more nodes representing the tops of any sub-trees defining the structure of the document. CATIDOMDocumentFragment 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 CATIDOMDocumentFragment might have only one child and that child node could be a CATIDOMText node. Such a structure model represents neither an HTML document nor a well-formed XML document.

When a CATIDOMDocumentFragment is inserted into a CATIDOMDocument (or indeed any other CATIDOMNode that may take children) the children of the CATIDOMDocumentFragment and not the CATIDOMDocumentFragment itself are inserted into the CATIDOMNode. This makes the CATIDOMDocumentFragment very useful when the user wishes to create nodes that are siblings; the CATIDOMDocumentFragment acts as the parent of these nodes so that the user can use the standard methods from the CATIDOMNode interface, such as CATIDOMNode.InsertBefore and CATIDOMNode.AppendChild.

See also:
CATIDOMDocument, CATIDOMNode



This object is included in the file: CATIDOMDocumentFragment.h
If needed, your Imakefile.mk should include the module: CATXMLParserItf

Copyright © 2003, Dassault Systèmes. All rights reserved.