LDOM Package

 

The LDOM package allows to write and read XML files. It constitutes an integral part of XML OCAF persistence, which is the optional component provided on top of Open CASCADE.

The Light DOM (LDOM) package contains classes maintaining a data structure whose main principles conform to W3C DOM Level 1 Recommendations. The purpose of these classes as required by XML OCAF persistence schema is to:

This package covers the functionality provided by numerous products known as "DOM parsers". Unlike most of them, LDOM was specifically developed to meet the following requirements:

Both these requirements are important when XML files are processed by applications since these files are relatively large (occupying megabytes and even hundreds of megabytes). To meet the requirements, some limitations were imposed on the DOM Level 1 specification; these limitations are insignificant in applications like OCAF. Some of these limitations can be overridden in the course of future developments. The main limitations are:

  1. No Unicode support as well as various other encodings; only ASCII strings are used in DOM/XML. Note: There is a data type TCollection_ExtendedString for wide character data. This type is supported by LDOM_String as a sequence of numbers.

  2. Some superfluous methods are deleted: getPreviousSibling, getParentNode, etc.

  3. No resolution of XML Entities of any kind

  4. No support for DTD: the parser just checks for observance of general XML rules and never validates documents.

  5. Only 5 available types of DOM nodes: LDOM_Element, LDOM_Attr, LDOM_Text, LDOM_Comment, LDOM_CDATASection.

  6. No support of Namespaces; prefixed names are used instead of qualified names.

  7. No support of the interface DOMException (no exception when attempting to remove a non-existing node).

LDOM is dependent on Kernel Open Cascade classes only. Therefore, it can be used outside OCAF persistence in various algorithms where DOM/XML support may be required.

See also:

Document Drivers

Attribute Drivers

XML Document Structure

XML Schema