Chapter 8. Document Manager

Table of Contents

Database Definitions

The Document Manager database specification is heavily based on existing XML object models, especially that for libxml2. It takes advantage of PostgreSQL's object inheritance capabilities to allow for abstraction of the various node types that can be encountered in XML documents and DTDs.

The XML_Node_Root provides code data for all nodes in the XML tree. The remainder of the tables described in this section will inherit their core management structure from XML_Node.

Table 8.1. XML_Node_Root

NameTypeNulls?DefaultDescription
Node_IDintegerNn/aUnique ID for this XML Node
Seq_NointegerNn/aA "revision number" for this row. The sequence number supports locking validation and history.
Latest_IndbooleanNTRUEIndicates that this row is the latest entry for this particular Node_ID. (Note that one should also verify that End_Date is NULL to determine that this is an active Xml_Node.)
Name_TxttextYNULLWhere applicable, the name of this Xml_Node
Dtd_Node_IDintegerYn/aNode_ID of the root node of the DTD in which this node is defined.
Doc_Node_IDintegerYn/aNode_ID of the document in which this node was found.
Top_Node_IDintegerNn/aNode_ID of the top of the document in which this node was found. This will be identical to either the Dtd_Node_ID or the Doc_Node_ID, depending upon from where this node was sourced.
Level_NointegerNn/aNesting Depth for this node. Level_No of zero (0) indicates a Doc or DTD root node.
Sort_NointegerNn/aOrder in which this node occured within the document identified by Top_Node_ID
Range_End_nointegerNn/aLargest Sort_No that can be had by a child of this node. Given two nodes with a parent-child relationship, it will be true that parent.sort_no < child.sort_no <= child.range_end_no <= parent.range_end_no and that parent.level + 1 == child.level.
Create_TstptimestampN'now'Timestamp (UTC) at which this particular row was created.
Update_TstptimestampN'infinity'Timestamp (UTC) at which this particular row was superceded by one with the next Seq_No.
Start_DatedateN'today'Date on which this Node (as identified by its Node_ID) was first created.
End_DatedateN'infinity'Data on which this Node (as identified by its Node_ID) was removed from its owning document.

The XML_Attr represents an attribute and its value within an XML element. The value will be stored in an XML_Element_Text

Table 8.2. XML_Attribute

NameTypeNulls?DefaultDescription
Inherits XML_Node
Ns_Defn_IDintegerNn/aNamespace definition to which this element belongs
Attribute_Type_IDintergerYYType of attribute, if XML validating is active.

The tables described in this section are not descended from XML_Node_Root.

Describes namespaces by URL. XML_Ns_Defn associates namespaces to particular references to them in individual documents.

Table 8.5. XML_Namespace

NameTypeNulls?DefaultDescription
Namespace_IDintegerNn/aUnique ID for this XML Node
Global_Ns_IndbooleanNFALSEIndicates that this is a global name space.
Ns_Url_TexttextNn/aURL that uniquely identifies this name space.

Associates namespaces to 'xmlns:ns=' definitions is individual documents and elements.

Table 8.6. XML_Namespace

NameTypeNulls?DefaultDescription
Namespace_IDintegerNn/aUnique ID for this XML Node
Node_IDintegerNn/aIdentfier of the node where the namespace was referenced
Ns_Prefix_TexttextNn/aText prefix to be used to reference this name space.