Other standards and extensions to XML work together to make your information more portable and useful.
XML is very good for describing information, but it cannot do everything. For example, XML documents do not contain the kind of information that current browsers and many other devices require to display it in a useful way. The same is true for linking to other information, transporting XML data so that it can be used in a meaningful way by the receiving application, and so on.
The XML community has and continues to develop standards and extensions to expand the capabilities of XML:
Application programming interfaces (APIs) allow applications to work with XML information using a standard set of portable interfaces. For more information, see XML tools integrated in i5/OS™ for links to API documentation for a supported parser.
DOM and DOM Level 2
The Document Object Model (DOM) API enables you to build XML documents as well as parse them. With these interfaces you can access, manipulate, and create XML documents (and the data within) as programming objects that have methods and events. Your programs can construct or change a DOM tree in memory and then persist that DOM tree to a file or stream. DOM is best suited for instances where you will parse few XML documents but require extensive control over the contents.
SAX
The Simple API for XML (SAX) is a read-only, single-pass interface best suited for processing many documents or very large documents. You can use this API to extract information from the XML documents, but you cannot use it to add data to or change the content of the XML documents. The SAX API is event-driven, notifying your application when certain events happen as it parses your document. For example, your application might need to know when the parser encounters the start or end of an element node. Note that it is your application that must keep the necessary state information to determine the content and context of these XML events.
For links to more information about the DOM and SAX APIs, see the XML related information.
For the most current versions of these APIs, see the XML Toolkit for iSeries (5733-XT1) product documentation.
Extensible Stylesheet Language (XSL) and Extensible Stylesheet Language Transformations (XSLT) work in combination for you to display XML data in a variety of ways, for example, in a browser or on a PDA, or printed in a brochure. With XSL and XSLT processing you can transform an XML message or document from one XML markup language to another, which has key applications in e-business.
A detailed explanation of the mechanics of this process is beyond this article. Briefly, however, the process has two basic components:
These technologies do more than format the display of an XML document, they change it so that it becomes a different kind of document. In conjunction with other XML tools and extensions, such as parsers and XLink, you can produce documents formats such as specific word processing formats, PDF, HTML, and more.
For links to more information about XSL and XSLT, see the XML related information.
XML Linking Language (XLink) enables you to link your XML document to other resources on the Web, including files of just about any format, database searches, and so on. Moreover, you can link to the structure of the resource, not a predetermined place holder, like an HTML <A NAME> anchor tag. Multiple links allow users to traverse the linked information in any order based on restrictions that you specify.
For links to more information about XLink, see the XML related information.
XML Path Language (XPath) and XML Pointer Language (XPointer) enable you to search for and identify data in the hierarchical XML document structure.
XPath defines a syntax for locating data in an XML document. (Both XSLT and XPointer use XPath.) XPath defines an XML document as a hierarchy of nodes, with the top node being the root. Just like using a regular expression finds one or more patterns in text, using XPath finds patterns in data within the nodes of one or more XML documents.
XML Pointer Language (XPointer) extends XPath to enable locating specific portions of data (called fragments) based on XML attribute values, types, content, or relative position. These fragments can be seperate pieces of data, a range of information between two points, or a continuous series of elements.
For links to more information about XPath and XPointer, see the XML related information.
Namespaces are pointers (URIs) that enable you to differentiate between duplicate XML elements or attribute names, a situation that can occur when using XSLT stylesheets or more than a single DTD. For example, the <code> element from one DTD might mean something very different from a <code> element in another DTD. To avoid name collisions and ambiguity, giving each URI a unique local name makes it simple to distinguish between the different namespaces.
XML Schema Language defines the logical structure of an XML document, much like a DTD.
The significant difference between DTDs and XML Schemas are that schemas:
All of these enhancements giving you more control over the allowable content of the XML document/message.
For example, you can add a different type of element to an existing schema as long as your addition does not break the original schema. Schemas also have many more available datatypes than do DTDs, making importing and exporting data somewhat easier.
For links to more information about Namespaces and XML Schema Language, see the XML related information.