Attribute Drivers

 

There is one attribute driver for XML persistence for each transient attribute from a set of standard OCAF attributes, with the exception of attribute types, which are never stored (pure transient). Standard OCAF attributes are collected in six packages, and their drivers also follow this distribution. Driver for attribute T*_* is called XmlM*_*. Conversion between transient and persistent form of attribute is performed by two methods Paste() of attribute driver.

XmlMDF_ADriver is the root class for all attribute drivers.

At the beginning of storage/retrieval process, one instance of each attribute driver is created and appended to driver table implemented as XmlMDF_ADriverTable.
During OCAF Data storage, attribute drivers are retrieved from the driver table by the type of attribute. In the retrieval step, a data map is created linking names of DOM_Elements and attribute drivers, and then attribute drivers are sought in this map by DOM_Element qualified tag names.

Every transient attribute is saved as a DOM_Element (root element of OCAF attribute) with attributes and possibly sub-nodes. The name of the root element can be defined in the attribute driver as a string passed to the base class constructor. The default is the attribute type name. Similarly, namespace prefixes for each attribute can be set. There is no default value, but it is possible to pass NULL or an empty string to store attributes without namespace prefixes.

The basic class XmlMDF_ADriver supports errors reporting via the method WriteMessage(const TCollection_ExtendedString&). It sends a message string to its message driver which is initialized in the constructor with a Handle(CDM_MessageDriver) passed from the application by Document Storage/Retrieval Driver.

Synopsis

XmlMDF

defines the basic class for all attribute drivers, the methods for OCAF labels tree conversion, and implements drivers for TDF_Reference and TDF_TagSource

XmlMDocStd

contains drivers for TDocStd_XLink attribute

XmlMDataStd

contains drivers for attributes from package TDataStd

XmlMNaming

contains drivers for attributes from package TNaming

XmlMFinction

contains drivers for attributes from package TFunction

XmlMPrsStd

contains drivers for attributes from package TPrsStd

See also

Document Drivers