Skip to main content


developerWorks  >  XML | Java technology  >

XML programming in Java technology, Part 1

developerWorks

Level: Introductory

Doug Tidwell (dtidwell@us.ibm.com), XML Evangelist, IBM

13 Jan 2004

Register now or sign in using your IBM ID and password.

This updated tutorial covers the basics of manipulating XML documents using Java technology. Doug Tidwell looks at the common APIs for XML and discusses how to parse, create, manipulate, and transform XML documents.

Prerequisites

XML has become a universal data format. This updated tutorial introduces the common APIs for XML and discusses how to parse, create, manipulate, and transform XML documents. The tutorial examines different ways to do these common tasks, the standards involved, and when to use a specific approach.

The tutorial explores the following APIs:

  • The Document Object Model (DOM), Level 2
  • The Simple API for XML (SAX), Version 2.0
  • JDOM, a simple Java API created by Jason Hunter and Brett McLaughlin
  • The Java API for XML Processing (JAXP)

Other tutorials in this series are:


System requirements

You will need JavaScript enabled on your browser.

To run the examples, set up your machine as follows:

  1. Download the Xerces XML parser at the Apache XML Project (http://xml.apache.org/xerces2-j/) or directly from the download page (http://xml.apache.org/xerces2-j/download.cgi).
  2. Unzip the downloaded file from Apache to create a directory named xerces-2_5_0 (or something similar, depending on the release level of the parser). The JAR files you need (xercesImpl.jar and xml-apis.jar) should be in the Xerces root directory.
  3. Download the latest version of JDOM from the JDOM project's Web site (http://jdom.org/).
  4. Unzip the file downloaded from JDOM to create a directory named jdom-b9 (or something similar). The JAR file you need (jdom.jar) should be in the build directory.
  5. Finally, download the zip file of examples (xmlprogj.zip) for this tutorial and unzip the file. Note: You must register for the tutorial before you can download this zip file (https://www6.software.ibm.com/developerworks/education/xmljava/xmlprogj.zip) from the Introduction > Setting up your machine panel.
  6. Add the current directory (.), xercesImpl.jar, xml-apis.jar, and jdom.jar to your CLASSPATH.


Duration

Under one hour


Formats

html, pdf


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!


Back to top


Document options

Document options requiring JavaScript are not displayed