XML is an integral part of J2EE. It appears in the following areas of J2EE application development:
Web application deployment descriptors (web.xml)
Tag Library Descriptor files (TLDs)
Bean deployment descriptors (ejb-jar.xml)
Multiple views of data for different types of clients using transformations
SOAP and Web Services development
Proprietary DTDs for B2B XML-based interchanges
This section describes where XML fits into J2EE and how JRun uses XML. It also points you to additional resources on XML.
XML Extensions to Java
Java includes many extensions that enable XML in your web applications. The following table describes the XML extensions to the Java language:
Extension
Description
JAXP
Java API for XML Processing. JAXP provides a common interface for creating and using the standard SAX, DOM, and XSLT APIs in Java, regardless of which vendor's implementation is actually being used.
JAXM
Java API for XML Messaging. JAXM defines a mechanism for exchanging asynchronous XML-based messages between applications.
JAXB
Java Architecture for XML Binding. JAXB defines a mechanism for writing Java objects as XML and for creating Java objects from such structures.
JAX-RPC
Java API for XML-based Remote Process Communications. JAX-RPC defines a mechanism for exchanging synchronous XML-based messages between applications.
JAXR
Java API for XML Registry. JAXR provides a mechanism for publishing available services in an external registry, and for consulting the registry to find those services.
XML processing tools
Java includes many tools for processing XML files in your web applications. The following table describes some of the technologies that let you process XML files
Technology
Description
XSLT
XML Stylesheet Language for Transformations. XSLT transforms documents in one XML format into another XML format.
SAX
Simple API for XML. SAX is an event-driven, serial-access mechanism that does element-by-element processing. SAX reads and writes XML to a data repository or the web.
DOM
Document Object Model. A DOM is a very simple data structure that intermixes text nodes, element nodes, processing instruction nodes, CDATA nodes, entity references, and several other kinds of nodes.
JDOM
Java Document Object Model. JDOM is a "Java-optimized" document object model API from http://www.jdom.org. While JDOM operates with existing standards such as the Simple API for XML (SAX) and the Document Object Model (DOM), it is not an abstraction layer or enhancement to those APIs.
Defined by JSR-102.
DOM4J
Document Object Model for Java. DOM4J is an open-source, object-oriented alternative to DOM.
XPath
XML Path Language. XPath is a language for addressing parts of an XML document, designed to be used by both XSLT and XPointer.
XPointer
XPointer, which is based on the XML Path Language (XPath), supports addressing into the internal structures of XML documents. It lets you examine a hierarchical document structure and choose its internal parts based on various properties, such as element types, attribute values, character content, and relative position.
XDoclet
XDoclet is an extended JavaDoc Doclet engine that creates custom Javadoc files, based on source code or other files, using a template engine. XDoclet also generates web.xml, jrun-web.xml, and ejb-jar.xml files.
:
JRun and XML
XML is integral to JRun. JRun uses XML in the following ways:
Transforms JSP pages from HTML/JSP syntax markup into compiled servlet code.
Uses Ant/build files for creating JRun installers.
Uses SAX and DOM to parse, read and update standard J2EE web application configuration files.
Uses XMLScript utility to execute a subset of XPath commands on configuration files.
The following table describes the tools included in JRun for working with XML:
Tool
Description
Location
Crimson
SAX/DOM parser. Supports SAX 2 and DOM 2. Version 1.1.
In the org.apache.crimson package.
jrun_root/lib/jrun.jar
Xalan
XSLT processor. Uses JAXP version 1.1.
jrun_root/lib/jrun.jar
JDOM
DOM parser. Version Beta 7.
jrun_root/lib/jrun.jar
XMLScript
XPath-based XML scripting utility. In the jrunx.xml package.
jrun_root/lib/jrun.jar
XPath
XPath implementation from Apache.
jrun_root/lib/jrun.jar
XDoclet
Custom JavaDocs and XML deployment descriptor creation utility.
jrun_root/lib/jrun-xdoclet.jar
More information
The following table provides links to various resources on the Sun website to help you get started using XML and the associated technologies: