If you're using Java 1.4.x or above, you already have built-in support for XML. This tutorial explains how to use that support to create and manipulate XML Document Object Model objects.
Tutorial Details:
XML Reference Guide
Because XML is a platform-independant language, using Java to manipulate it seems a natural choice. In fact, more than one DOM (or more specifically, DOM-like) implementation exists for Java, and the tools necessary for working with it have even been built into the langauge itself as of version 1.4.
As of version 2.0, the Document Object Model defines the ways and means of manipulating a Document object and the objects cotnained by it, but doesn't define any way to create, load, or save (or persist, serialize, or whatever other verb you'd like to use) a Document. In this section, we'll get a feel for how these manipulations work by loading a simple document, making some changes to it, and then using a simple "cheat" to save it back out to a file.
Consider, for example, the following sample file, candy.xml :
<?xml version="1.0"?>
<candy>
<product>Mints</product>
<product>Chocolate</product>
<product>Circus Peanuts</product>
</candy>
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: XML Java and XML DOM and Java Tutorial
View Tutorial: XML Java and XML DOM and Java Tutorial
Related
Tutorials:
XML JavaBeans, Part 3 - JavaWorld July
1999
XML JavaBeans, Part 3 - JavaWorld July
1999 |
Java makes the most of XML's extensibility - JavaWorld July
1999
Java makes the most of XML's extensibility - JavaWorld July
1999 |
Programming XML in Java, Part 3 - JavaWorld July
2000
Programming XML in Java, Part 3 - JavaWorld July
2000 |
Easy Java/XML integration with
JDOM, Part 1 - JavaWorld May 2000
Easy Java/XML integration with
JDOM, Part 1 - JavaWorld May 2000 |
Mapping XML to Java, Part 1 - JavaWorld August 2000
Mapping XML to Java, Part 1 - JavaWorld August 2000 |
Validation with Java and XML Schema, Part 2 - JavaWorld October 2000
Validation with Java and XML Schema, Part 2 - JavaWorld October 2000 |
Combine the power
of XPath and JSP
tag libraries -
JavaWorld January
2001
Combine the power
of XPath and JSP
tag libraries -
JavaWorld January
2001 |
XML APIs for databases - JavaWorld January 2000
XML APIs for databases - JavaWorld January 2000 |
Use XML data binding to do your
laundry
Use XML data binding to do your
laundry |
XML glossary
XML glossary |
The Java Web Services Tutorial
This tutorial is a beginner\'s guide to developing Web services and Web applications using the Java Web Services Developer Pack (Java WSDP). |
The J2EE 1.4 Tutorial
The J2EE 1.4 Tutorial is a guide to developing enterprise applications for the Java 2 Platform, Enterprise Edition (J2EE) version 1.4. Here we cover all the things you need to know to make the best use of this tutorial. |
FastParser 1.6.3
FastParser 1.6.9.1
XML Edition
FastParser is a Java Xml parser
High performance XML parser (benchmarks* : up to +100% faster compared to Xerces and JDK1.4 integrated parser)
SAX Level 1 and 2 compliant
DOM support
JAXP compatibility
Names |
The State of JAXB: Availability, Suitability, Analysis, and Architecture
The State of JAXB: Availability, Suitability, Analysis, and Architecture
When working with XML in OO languages, there is little doubt that objects provide distinct advantages as compared to SAX, DOM, or raw XML. This process of working with XML and obj |
XML DOM-lite parser and writer
Summary
This article provides a simple method for creating valid XML and a simple DOM-like (Document Object Model) parser. This method is useful for small applications that need simple XML functionality without the size and complexity of the full range d |
XML Document Validation with an XML Schema
This tutorial explains the procedure of validating an XML document with an XML schema. |
FOP is the world's first print formatter driven by XSL formatting objects.
It is a Java application that reads a formatting object tree and then turns it into a PDF document. The formatting object tree, can be in the form of an XML document (output by an XSLT engine like XT or Xalan) or can be passed in memory as a DOM Document |
The JavaTM Web Services Tutorial
A beginner's guide to developing Web services and Web applications on the Java Web Services Developer Pack |
This tutorial shows how to Combine the power of XPath and JSP tag libraries
In this article, we'll examine the XPath custom tag library for JSPs and see a tag collection that provides simple control constructs and a uniform attribute value substitution facility, all of which combine to reduce complexity and improve functionality. |
Generating an XML Document with JAXB
In this tutorial, JAXB is used to generate Java classes from an XML Schema. An example XML document shall be created from the Java classes. |
|
|
|