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.

| See all 2 comments

Newest comments

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 a ...
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 ...
  
xmlhack: developer news from the XML community

Front page | Search | Find XML jobs

Related categories
XML
Community