Processing Instructions

printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    

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.


printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    
Top

[0672324342/app02lev1sec6]

 
 


JavaT APIs for XML Kick Start
JAX: Java APIs for XML Kick Start
ISBN: 0672324342
EAN: 2147483647
Year: 2002
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net