OpenEdge Development: Working with XML - Product ...
OpenEdge Development: Working with XML - Product ...
OpenEdge Development: Working with XML - Product ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Reading and Writing <strong>XML</strong> <strong>with</strong> the Document Object Model (DOM)<br />
The ABL DOM interface<br />
2–6<br />
The Document Object Model (DOM) is the original application programming interface (API)<br />
for <strong>XML</strong> documents, as defined by the W3C. It continues to be the W3C recommendation.<br />
Note: Chapter 1, “Developing <strong>with</strong> <strong>XML</strong> in <strong>OpenEdge</strong>,” provides a comparative<br />
introduction to the ABL DOM interface. See this chapter if you are currently<br />
evaluating which ABL features best meet your needs for handling <strong>XML</strong> documents in<br />
ABL applications.<br />
A software module called an <strong>XML</strong> parser is used to read <strong>XML</strong> documents and provide access<br />
to their content and structure. The <strong>XML</strong> parser does its work on behalf of another software<br />
module—your application. ABL simplifies your interaction <strong>with</strong> DOM and its parser by<br />
providing the familiar ABL programming constructs of built-in objects, handles, attributes, and<br />
methods. This section describes the ABL objects that make up the DOM interface.<br />
Note: The DOM API is designed to be compatible <strong>with</strong> a wide range of programming<br />
languages. In implementing DOM <strong>with</strong>in the ABL, Progress Software Corporation<br />
adapted the specification to fit smoothly into the ABL environment. In some cases, the<br />
World Wide Web Consortium (W3C) naming conventions conflicted <strong>with</strong> familiar<br />
ABL naming conventions. In other cases, functionality in the DOM specification was<br />
already available in ABL. In all these cases, the established ABL naming and<br />
functionality was preserved.<br />
Prerequisites<br />
The ABL DOM interface is most quickly employed if:<br />
• You understand <strong>XML</strong><br />
• You understand DOM programming<br />
• You understand ABL programming including the use of built-in objects and their handles,<br />
methods, and attributes<br />
If you have not yet learned <strong>XML</strong>, then DOM programming is not a productive starting point for<br />
you. Take the time to learn basic <strong>XML</strong> <strong>with</strong> any one of the many online or printed tutorials.<br />
If you understand DOM, then you will find the ABL implementation to be a useful one that<br />
implements all the features of DOM that are needed by an ABL programmer. It is not a complete<br />
implementation of the entire DOM specification.<br />
If you are not a DOM programmer, you can use this chapter to understand the ABL<br />
implementation and to develop pragmatic skills for reading and writing <strong>XML</strong> documents, as<br />
well as building <strong>XML</strong> documents or fragments in memory. The ABL implementation takes a<br />
somewhat difficult technology and makes it much easier to exploit <strong>with</strong>in the ABL<br />
environment.