XML
Are PIs deprecated?
11:55, 24 Jan 2003 UTC | Eric van der Vlist

Jeni Tennison reopens the debate about Processing Instructions (PIs )on xml-dev by proposing to define guidelines for using them.

Although part of the XML 1.0 recommendation, and used to associate stylesheets to XML documents, PIs have been ignored by most of the other W3C specifications.

Considered for defining namespaces, their usage has been rejected in favor of the attributes based syntax which we currently use. W3C XML Schema has not only preferred to use attributes for its needs (for instance to locate relevant schemas in instance documents) but even defined a specific element (xs:annotation) to avoid users using PIs for their own needs in schemas.

PIs appear thus to be banned from official specifications.

The first answers to Tennison's question seem to prove that there is nevertheless a strong need for PIs to carry information kept hidden from traditional applications:

  • Tommie Usdin uses them in sample documents to tag the sections needing to be included in documentation.
  • Rick Jelliffe uses them in publishing is to add soft and hard breaks for a particular production run.
  • Michael Kay uses them as markers to include generated content such as a table of contents or glossary.

One of the strengths of PIs is that they are ignored by XML schema languages (except by Schematron, by which they are still ignored unless specifically specified) and together with comments they are the last feature which keeps XML extensible when closed schemas are published.

Re: Are PIs deprecated? (Neil Padgen - 09:42, 5 Feb 2003)

XMetaL uses a PI to indicate replaceable text:

<?xm-replace_text {replacable}?>

will show up as the string "{replacable}", highlighted with one click to enable easy replacement by typing.

Re: Are PIs deprecated? (Yannis Haralambous - 12:46, 30 Jan 2003)

I have developped a DTD/Schema called XLaTeX which contains elements and attributes corresponding to LaTeX commands and environments. In a future stage XLaTeX documents will be read directly by Omega, the successor of TeX, to produce the same output as nowadays LaTeX documents. The advantage of XLaTeX over LaTeX being of course that we are dealing with XML documents which can be validated, and can also use elements from other namespaces like MathML or SVG.

PIs are crucial for XLaTeX because they allow users to insert raw LaTeX code whenever this is necessary. Only a by a multiple-level approach (high-level : XML mark up, low-level : LaTeX code, not to mention the even lower levels : plain TeX code, PostScript code insertions, etc.) can we cover all the needs of electronic documents. People who are using only simple LaTeX commands will use only XLaTeX elements and attributes; people who are programming in LaTeX will use XLaTeX Processing Instructions.

For this project, PIs are absolutely indispensable.

  
xmlhack: developer news from the XML community

Front page | Search | Find XML jobs

Related categories
XML
Community