Skip to main content

XML Enhancements for Java

A set of language extensions that facilitate XML processing in Java.

Date Posted: March 31, 2005

alphaworks tab navigation


 

Update: November 22, 2006 New release includes support for updates and better XPath compilation and typechecking.

 

What is XML Enhancements for Java?

XML Enhancements for Java™ (XJ) is a framework for writing efficient XML processing applications more easily. XJ includes a set of extensions to Java 1.4 that integrate support for XML, XML Schema, and XPath 1.0 into the language. The advantages of XJ over existing mechanisms for XML development are as follows:

In XJ, one can import XML schemas just as one does Java classes. All the element declarations in the XML schema are then available to programmers as if they were Java classes. Programmers can write inline XPath expressions on these classes, and the compiler checks them for correctness with respect to the XML schema. In addition, the compiler performs optimizations in order to improve the evaluation of XPath expressions. A programmer may construct new XML documents by writing XML directly inline. Again, the compiler ensures correctness with respect to the appropriate schema. By integrating XML and Java, XJ allows programmers to reuse existing Java libraries in the development of XML code and vice-versa.

This technology runs on Windows®, Linux®, and UNIX®.

How does it work?

The XJ package includes a compiler xjc analogous to javac and an execution environment xj analogous to java. All Java programs can be compiled "as is" without modifications, using xjc, and can be run using xj. In addition, xjc compiles programs written using the XJ XML extensions into pure Java code where all accesses to XML data are performed using DOM accesses.

For further information, please visit the XJ Research Web site, including a tutorial on XJ.

About the technology author(s)

Significant contributors to XJ are as follows: Rajesh Bordawekar, Michael Burke, Rohit Fernandes, Matthew Harren, Igor Pechtchanski, Mukund Raghavachari, Vivek Sarkar, and Oded Shmueli. All the work was performed at the IBM T. J. Watson Research Center in Hawthorne, NY.

Trademarks




Related technologies