Google News
logo
XML - Interview Questions
What is Processing Instructions in XML?
Processing Instruction is defined in the XML standard, XML 1.0 Recommendation. The definition says: "Processing instructions (PIs) allow documents to contain instructions for applications… PIs are not part of the document's character data, but MUST be passed through to the application."
 
Following is the syntax of PI :
<?target instructions?>
And some examples :
<?display table-view?>
<?sort alpha-ascending?>
<?textinfo whitespace is allowed ?>
<?elementnames <fred>, <bert>, <harry> ?>
In the real world PIs are seldom used with a few common exceptions. The PI is the official method for an XML document to link to a stylesheet, and Microsoft uses PIs in MS Office 2003 to make it easy for MS Word and MS Excel documents to be identified when saved as XML :
<?xml-stylesheet href="style.css" type="text/css"?>
Advertisement