Home > Class Reference > ENSLIB namespace > %XML.ImportHandler

%XML.ImportHandler

class %XML.ImportHandler extends %XML.SAX.ContentHandler

SAX Content handler for Cache' Objects XML Implementation.

This class and the data structure defined here is used internally by Caché. You should not make direct use of this class or data structure within your applications. The global data structure may be accessed using the macros in %xmlDOM.inc or by using the %XML.Node class. There is no guarantee made about either the behavior or future operation of this class.

This content handler stores the XML document as nodes of a tree. The GlobalName property determines where these nodes are stored. The default for the GlobalName property is ^||%xmlTemp. The Tree property determines the specific node used to store the nodes of the tree. The structure of the tree is as follows:

The tree is stored @..GlobalName@(..Tree) which is stored in ..DocumentId. @..GlobalName@(..Tree) - number of nodes. @i%DocumentId@(node) describes the node given by the integer node number.

Each XML DOM node will be described by a 4 character entry node descriptor.
Since any node will be the child of an element node, the node descriptor entries will be
stored in the childlist of its parent which is in the element descriptor node or one of its extension nodes.  
The attribute nodes will be first in the element descriptor node in the order that they are 
presented by Xerces.  Element and character node entries follow in the XML document order.
Each element descriptor is limited to the maximum length Cache string.  
Thus provision is made for extension child lists.
The list of element and character nodes is terminated by a next descriptor node which is
a reference to the next extension or 0 for the last.
Each element descriptor node and element descriptor extension node is structured as follows:
@i%DocumentId@(node) is 28 character base followed by the list of node descriptors. @i%DocumentId@(node) = CLparent_CLoffset_name_(prefix|flags)_elementOffset_URI_line_column_ChildList CLparent($zlchar) is the node number of the parent's child list which contains this node's descriptor. CLoffset($zlchar) is the 1-based offset in characters in CLparent node of this node's descriptor. name ($zlchar) - index of element name in the name dictionary. prefix($zlchar\16) - index of the prefix part of the QName (including ':') in the name dictionary or 0 if no prefix If the qname and the unqualified name are the same, then the prefix is not present. flags($zlchar#16) right-most bit (1) if xsi:nil or xsi:null specified as true or 1 second bit (2) is skip flag elementOffset($zwchar) is the offset of the first child element in the child list. This value is 29+(numAttrs*16) for the first child list and 29 for all subsequent child lists. URI($zwchar) is index of the URI for this element or not stored. line($zlchar) part of the location for element node. column($zlchar)