12.9 XML and Java: A Quick Look


Extensible Markup Language (XML) describes a class of data objects called XML documents that are stored on computers, and partially describes the behavior of programs that process these objects. XML became a W3C Recommendation on February 10, 1998.

XML background

XML is an application profile, or restricted form, of Standard Generalized Markup Language (SGML). The goal of XML is to enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML has been designed for ease of implementation and for interoperability with both SGML and HTML (Parziale, et al. 2006). XML and HTML were designed with different goals (W3Schools):

XML was designed to transport and store data, with focus on what data is
HTML was designed to display data, with focus on how data looks


HTML is about displaying information, while XML is about carrying information. A lot of new Internet languages are created with XML. Here are some examples (W3Schools):

XHTML: Extensible Hyper Text Markup Language.

12.9 XML and Java: A Quick Look


WSDL: Web Services Description Language for describing available web services
Wireless Application Protocol (WAP) and Wireless Markup Language (WML) as markup languages for handheld
devices
Really Simple Syndication (RSS) languages used for news feeds. It defines an easy way to share and view
headlines and content.
Resource Description Framework (RDF) and OWL (Web Ontology Language) for describing resources and
ontology.
Synchronized Multimedia Integration Language (SMIL) for describing multimedia for the web.

XML and Java

The Java and XML technologies are complementary. The Java technology provides the platform-independent, maintainable code that is needed to process platform independent XML data. In addition, the Java technology offers a substantial productivity boost for software developers compared to programming languages such as C or C++ (Banerjee 2004).

12.9 XML and Java: A Quick Look


Using XML and Java together, developers can build powerful web-based applications and platform-independent web-based applications more quickly and at a lower cost (Banerjee 2004). Simple API for Java (SAX) is a lightweight and powerful standard Java API for processing XML. JDOM is an open source Java-based document object model for XML that was designed specifically for the Java platform so that it can take advantage of its language features. JDOM integrates with Document Object Model (DOM) and SAX.

One of significant addition has been the inclusion of JAXP, the Java API for XML Parsing, which includes three packages (Biggs and Evans 2001):

org.w3c.dom, the Java implementation of the World Wide Web Consortium (W3C)'s recommendation for a
standard programmatic Document Object Model for XML
org.xml.sax, the event-driven Simple API for XML parsing
javax.xml.parsers, a factory implementation that allows application developers to configure and obtain a particular
parser implementation