Creating Applications with Java API for XML Parsing (JAXP)
- Creating Applications with Java API for XML Parsing (JAXP)
- Understanding XML
- XML Related Tools
- Creating an XML Document
- Creating a Document Type Definition (DTD)
- Parsing with the Simple API for XML (SAX)
- Parsing with the Document Object Model (DOM)
- An XML Version of the CruiseList Application
- Summary
In This Chapter
Understanding XML
XML Related Tools
Creating an XML Document
Creating a Document Type Definition (DTD)
Parsing with the Simple API for XML (SAX)
Parsing with the Document Object Model (DOM)
An XML Version of the CruiseList Application
Most programs need to exchange data with other programs from time to time. Many techniques for making this exchange have been used over the years. Currently, the most popular approach to doing this is to create XML documents and transfer them to another computer where they can be parsed and the data processed.
Because XML documents are really text files, you can parse them any way that you like. Java programmers normally use the parsers that are found in the Java API for XML Parsing (JAXP). This chapter will introduce you to the use of these parsers.
XML is a set of rules that govern how you create a special language to describe your data. These rules provide a set of reserved characters and their usage in defining a set of tags that identify entities in your world. If you make up the tags according to the rules of XML, you will have access to a number of tools that will make parsing your data easier, once you are familiar with them. Getting you familiar with them is the main goal of this chapter.