Processing instructions (was XSchema: Sections 5.0 and 5.1)

Paul Prescod papresco at
Fri Sep 25 16:44:54 BST 1998

Michael Kay wrote:
> That gives me the opportunity to ask a question that's been
> bugging me for a while.
> I'm designing a document type. Is there any circumstance
> when you would advise me to use a Processing Instruction
> rather than an empty element with attributes? I can't think
> of one myself, but I'm sure the XML designers must have had
> something in mind.

Processing instructions are more for the use of people who are NOT
document type designers. Let's say your XML-smart HTTP server has a
replacement function for doing server-side variable includes (e.g. time,
date, last modified). Obviously that function cannot be tied to any
particular document type, because they can't force one document type on
all of their users. So they could specify it as a processing instruction
instead. The PI is "invisible" to DTD validation and thus doesn't
interfere with the doctype.

That was why namespaces originally used processing instructions. They
weren't supposed to interfere with document types (beyond the problems
with the prefixes, etc.). That's also why XML's own declarations are often
processing instructions.

 Paul Prescod  -

How many of the Congresspeople who voted for the CDA do you suppose
also voted to release the report that reads like a borderline por-
nographic dime-store romance written by a Texas preacher's son?
	- Keith Dawson, TBTF

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list