In addition to character data, XML also allows document authors to include specific instructions or commands to the processing application within the document. These instructions are referred to as "processing instructions", or PIs. PIs are not part of character data; instead, when an XML parser encounters a PI, it simply hands it over to the calling application, which has the option of using it (if it recognizes it) or ignoring it (if it doesn't.) Every PI includes a target - this is the string used to identify the application to which the instruction is directed - followed by some data. This target-and-data combination is enclosed with <?...?> tags, as demonstrated by the following example: This data will be used by the XML application - for example, the first PI could indicate that the category be marked as "popular", while the second could link the item description with an advertisement. If you take a look at the document prolog (discussed in the last article), you'll see that the first line in any XML document, is actually a processing instruction. This article copyright Melonfire 2001. All rights reserved.
blog comments powered by Disqus |