The XML Processor

Previous chapters focused on the data that goes into the XML processor. So you should now understand the rules and regulations for getting data into the processor and making sure that the data is in order. Now it's time to see the payoffs for that hard work.

Because XML only describes data and doesn't include instructions for how the processor should display that data, you need a way to manipulate the data into a workable format for eventual display. This is where the XML processor comes in. It should be apparent from previous examples that the primary job of the processor is to parse and validate the XML data. But the processor also manipulates the data into a format that can be used by an application. This is obviously another important processor function, since the data would not be useful if it could not be displayed. The processor, then, acts as a middle layer between the data and the display mechanism.

The Right Processor for the Job

Several commercial, shareware, and freeware XML processors are available—some are validating processors and others are nonvalidating. A nonvalidating processor provides performance benefits because it does not have to read and process a DTD. In many instances, well-formed XML code is good enough, so it's not necessary for the processor to go through the overhead of validating a document.

Many of the available processors are written in the Java programming language. While that might not seem very important, in fact the language in which the processor was written can make a difference in performance and availability. For example, although Java applications (including applets) tend to be slower than C++-based applications, Java can often work on multiple platforms. C++-based applications are typically smaller and faster. So generally speaking, if you are after the best performance and validation is not important to you, using a nonvalidating C++ processor is the way to go. But if you need to validate your documents and work on the widest range of platforms, a validating Java processor should be used.