Processing Instructions

As their name implies, processing instructions are instructions to the XML processor. These instructions start with <? and end with ?> . The only restriction here is that you can't use <?xml?> (or <?XML?> , which is also reserved). Processing instructions must be understood by the XML processor, so they're processor-dependant, not built into the XML recommendation.

A very common and well-understood processing instruction (although, like other processing instructions, not a part of the XML 1.0 recommendation) is <?xml-stylesheet?> , which connects a style sheet with the document. Here's an example:

 <?xml version = "1.0" standalone="yes"?>  <?xml-stylesheet type="text/css" href="greeting.css"?>  <DOCUMENT>     <GREETING>         Hello From XML     </GREETING>     <MESSAGE>         Welcome to the wild and woolly world of XML.     </MESSAGE> </DOCUMENT> 

XML processors such as Internet Explorer 6 and Netscape Navigator 6 or later understand <?xml-stylesheet?> already.

I've taken a look at everything a prolog can contain (except DTDs): XML declarations, comments, processing instructions, and whitespace. It's time to take a look at the actual structure of an XML document, as created with tags and elements.



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

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