2.7. Other XML constructs There are a few more XML constructs that you may need to know about, but which you will use less often if at all than those previously discussed. The details, including information about the nature and extent of Word's support for them, can be found in Chapter 15, "The XML language", on page 350. There are two, however, that show up in the examples that illustrate Part Two: processing instructions (PIs) and comments. They are both markup that is not part of the document structure or data. They are essentially messages: to software in the case of PIs, and to people in the case of comments. 2.7.1 Processing instructions Example 2-6 shows two processing instructions. The first word in each is the PI target, a nickname for the program for which the PI is intended. Example 2-6. Processing instructions <?xml version="1.0" encoding="UTF-8"?> <?mso-application prog?> The first PI is intended for the XML processor itself. It is called an XML declaration and it tells the processor the character encoding that is being used. Other software, such as Office, looks for this PI to recognize that a document is an XML document. The second PI is intended for Microsoft Office applications. It identifies the application that created the document. 2.7.2 Comments Comments can be used as reminders to yourself or as messages to other people working on the document. They are discarded when a document is parsed. Example 2-7. Comment <!-- Help, I'm a prisoner in a publishing house! --> |