PBDOM objects

PBDOM_OBJECT, the base class for PBDOM objects that represent XML nodes, inherits from the PowerBuilder NonVisualObject class. PBDOM represents node types by the following classes:

You use methods from these classes to access objects in a PBDOM node tree.

The PBDOM_BUILDER class does not represent DOM nodes but can be used to build a PBDOM object tree from XML. It inherits from the PowerBuilder NonVisualObject class.

The PBDOM_EXCEPTION class inherits from the PowerBuilder Exception class and provides a method that obtains error codes.

Each of these classes and their methods are described in the chapters that follow.

Comparing PBDOM objects with W3C DOM and JDOM objects

The following table shows the W3C DOM and JDOM objects that correspond to each PBDOM object that represents a node in the DOM tree. Note that although these W3C DOM and JDOM objects correspond to PBDOM objects, they are not equivalent to the PBDOM objects.

Table 4-1: W3C DOM and JDOM objects that correspond to PBDOM objects

PBDOM

W3C DOM

JDOM

PBDOM_ATTRIBUTE

ATTRIBUTE_NODE

Attribute

PBDOM_BUILDER

None

DOMBuilder

PBDOM_CDATA

CDATA_SECTION_NODE

CDATA

PBDOM_CHARACTERDATA

CHARACTER_DATA_NODE

None

PBDOM_COMMENT

COMMENT_NODE

Comment

PBDOM_DOCUMENT

DOCUMENT_NODE

Document

PBDOM_DOCTYPE

DOCUMENT_TYPE_NODE

DocType

PBDOM_ELEMENT

ELEMENT_NODE

Element

PBDOM_ENTITYREFERENCE

ENTITY_REFERENCE_NODE

EntityRef

PBDOM_OBJECT

NODE

None

PBDOM_PROCESSINGINSTURCTION

PROCESSING_INSTRUCTION_NODE

Processinginstruction

PBDOM_TEXT

TEXT_NODE

Text

Object hierarchy

The W3C DOM and JDOM object hierarchies also differ from the PBDOM object hierarchy, which is shown in the following illustration.

Figure 4-1: The PBDOM object hierarchy

the P B DOM object hierarchy is represented by linked rectangles with P B DOM _ Object as the base class. The node types branching from it are P B DOM _ Attirbute, character data, doctype, document, element, entity reference, and processing instruction. Descendants of p b dom _ character data are P B DOM _ COMMENT and P B DOM _ TEXT, which in turn has its descendant P B DOM _ C DATA. Also shown are unlinked rectangles for P B DOM _ BUILDER and P B DOM _ EXCEPTION.

For more information about working with PBDOM, see the chapter on PowerBuilder XML services in Application Techniques.