Store and retrieve XML documents

Extensible Markup Language (XML), as defined by the World Wide Web Consortium (W3C) provides rules, guidelines, and conventions for describing structured data in a plain text, editable file (called an XML document). XML uses tags only to delimit pieces of data, leaving the interpretation of the data to the application that uses it. XML is an method of representing data in an open, platform-independent format.

The currently available API for accessing XML documents is called JAXP (Java™ API for XML Parsing). The API has the following two subsets:
  • Simple API for XML (SAX) is an event-driven protocol, with the programmer providing the callback methods that the XML parser invokes when it analyzes a document.
  • Document Object Model (DOM) is a random-access protocol, which converts an XML document into a collection of objects in memory that can be manipulated at the programmers discretion. DOM objects have the data type Document.

JAXP also contains a plugability layer that standardizes programmatic access to SAX and DOM by providing standard factory methods for creating and configuring SAX parsers and creating DOM objects.

HCL OneDB™ extensions to the JDBC API facilitate storage and retrieval of XML data in database columns. The methods used during data storage assist in parsing the XML data, verify that well-formed and valid XML data is stored, and ensure that invalid XML data is rejected. The methods used during data retrieval assist in converting the XML data to DOM objects and to type InputSource, which is the standard input type to both SAX and DOM methods. The HCL OneDB extensions are designed to support XML programmers while still providing flexibility regarding which JAXP package the programmer is using.