Java APIs for XML Kick Start By Aoyon Chowdhury, Parag Choudhary
Table of Contents
Appendix B. XML: A Quick Tour
The next line in the CarParts.xml file is
<?supplierformat format="X13" version="3.2"?>
This is called a processing instruction(PI). A PI is a way for you to enter information in the XML document for a specific application. A PI takes the form <?target data?>, where target is the target application expected to do the processing, and data is the information passed on to the application for processing. In our example, when CarParts.xml is parsed by the parser application, it will pass on format="X13" version="3.2" to another application called supplierformat.
You need to keep in mind the following rules while working with PIs:
The data can be null or may contain spaces.
There should not be any space between <? and the target application.
The data for the target application begins after the first space, after the name of the target application.