Processing instruction guidelines
Hi, I'm trying to put together some guidelines about when we should use processing instructions and when some other construct (e.g. empty element, namespaced attribute) to pass information to an application. The fact that PIs can appear before and after the document element makes me think that they are good for holding instructions that effect the processing of the entire document, especially if those instructions are repeatable (e.g. the xml-stylesheet PI). Otherwise you have to use one or more structured attributes on the document element to achieve the same kind of effect (e.g. the xsi:schemaLocation attribute), which gets mighty ugly real quick. The fact that most schema languages (Schematron being one exception) can't constrain/don't care where PIs appear makes me think that PIs are good for holding information that can go anywhere without disrupting the main content of the document. For example, XMetaL uses them to hold deleted content and mark the start and end of inserted content, which seems very reasonable to me. Are there any other good uses for PIs? Does anyone have examples of *inappropriate* uses? I have the impression that some people think that any use of PIs is inappropriate, but I'm not sure what the argument is? Also, are there any guidelines about naming the targets of PIs? The ones that I've seen tend to use a naming scheme "prefix-localPart" where the prefix is used to indicate the authority or application involved and the local part is used to specify the name of the instruction itself. Is that fairly standard? Despite the fact that the XML Rec. suggests using notations to specify the legal names of PIs, I haven't actually seen that in use. Anyone think that it's good practice? What about PI data? Most PIs that I've seen use pseudo-attributes, I guess for extensibility. Is that standard practice? Thanks in advance for any comments or pointers to material on the topic. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format