Generating XML Documents

At this point you've looked at both parts of the XML Generator puzzle: the delimited text file and the XML template. Generating an XML document using these two files is as simple as running the XML Generator. The following is the command to run the XML Generator on the used vehicle example files:

java XMLGenerator VehicleTemplate.xml Vehicles.txt , Vehicles.xml

Executing this command creates the XML document Vehicles.xml, which contains the vehicle text data in a structured XML format. Listing 27.3 shows the code for the generated Vehicles.xml document.

Note

The examples of using a Java interpreter to run the XML Translator Generator applications are based on the standard Java interpreter that ships with the Java Development ...

Get XML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.