ODFDOM Hierarchical Model Overview
ODFDOM for Java provides a lightweight Java API for developers who want to create, access, and save ODF documents without having to know the complete ODF standard specification in detail.
The ODFDOM uses a hierarchical hierarchy of layers, each of which has a specific purpose. With loosely coupled design, the layers below do not depend on the layer above. Figure 1 shows the structure of the ODFDOM layered model.
Figure 1. ODFDOM Layered Model
These layers are briefly explained below:
Customized ODF document/scalable layer. This layer is called the custom layer at the back. Although it is not part of the ODFDOM package, it is designed as a layer above ODFDOM, where users can overwrite or customize existing ODFDOM APIs to meet specified requirements.
ODF Document/convenience functional layer. This layer is referred to as a convenience layer in the back. This is the focus of developers ' attention, because it is based on the DOM layer, providing users with the richest and easiest document manipulation APIs.
The dom/xml layer of the ODF type. This layer is called the DOM layer in the back. The ODFDOM specification and the grammar (Relaxng mode) define all the available ODF XML elements and attributes, as well as their relationships in the standardized ODF XML stream, which is all XML files (such as Content.xml, Styles.xml) in the ODF package.
The DOM layer provides information about the XML elements and attributes that are used to build Document Object Model. All classes on this layer are not written by hand, but are automatically generated by the ODF specification, so it is easy to update this layer when the ODF specification is improved or upgraded.
ODF Package/Physical layer. This layer is referred to as the package layer at the back. It is the lowest level in the ODFDOM hierarchy, providing direct access to physical storage in ODFDOM packages, such as XML streams, images, and embedded objects.
In the remainder of this article, we discuss each layer in detail and understand their capabilities and relationships.