Chapter 7
Parsing
XML Using Document Object Model(DOM)
IN THIS
CHAPTER
• What Is
DOM, Anyway?
• What DOM
Is Not
• Why Do I
Need DOM?
•
Disadvantages of Using DOM
• DOM
Levels
• DOM Core
• DOM
Traversal and Range
• Other DOM
Implementations
• Java
Architecture for XML Binding (JAXB)
Up to now, we have been talking about the basics of XML. You know what
an XML doc-ument looks like as well as the difference between well-formed and
validated documents. Also, we have looked at several schema representations.
There are tools that you can use to create XML documents and ways to exchange
these documents with commercial soft-ware, such as databases and word
processors. But what if you want to work with XML documents programmatically?
How do you go about writing your own software that cre-ates and reads an XML
document?
As you know, XML is made up of human-readable text, so you can write
your own code to manipulate XML. As you can probably guess, lots of people want
to do this, so there are standard ways of working with XML. You don’t have to write
a lot of the code your-self. Two of the most common tools for working with XML
are the Document Object Model (DOM) and the Simple API for XML (SAX).
In this chapter, we will explore DOM and look at several examples. We
will look at JDOM, a Java-centric API that is similar to DOM. We will explore
JAXB (or Java API for XML) binding. This is an effective way to map Java
objects to XML directly using automatically generated classes. Finally, we will
consider a real-world application of DOM by building an XML data server.
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.