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 ...

Get Inside XML 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.