[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Processing instruction guidelines

remove processing instruction xml
From: "Jeni Tennison" <jeni@j...>

> Are there any other good uses for PIs? Does anyone have examples of
> *inappropriate* uses? 

The most typical use of PIs in publishing is to add soft and hard breaks 
for a particular production run.   For example, in 3B2 you can add something 
    <?breakb b16?>
which says "the end of the line being currently set should be the break of the 
current column" (note this is a little different from the "soft return" which 
may mean "break here rather than in the immediate vicinity")

To remove these, process the text with a regex  like
or just
or the wildcard (in some search and replace systems)

Unless you have a pretty good typesetting system (i.e. smarter than TeX)
and an amenable page design or lucky data, documents often need to be
tweaked in the break/keep department to get professional quality.  Knuth,
for example, is quite frank about this, and it is no secret.  People doing
page updates may choose to use PIs to force the start or end of a page
so that it fits in.   (Whether to do this using the typesetting application's 
native GUI (if it has one) or in the markup is a local workflow issue.)

At some time in the future, I expect more systems will implement Unicode's
various break characters, and the need to use PIs for that will decrease.

If we had a validation infrastructure that allowed us to ignore or remove
elements or tags in certain namespaces, then we could use elements instead of
PIs and still validate. However, for using the data we would still need some
way to flag to an application that the element was only significant to some
other application: I cannot merrily go ahead and add elements in a new namespace
willynilly throughout a document against its schema and expect transformers or
consuming programmes not to barf.  

So we could replace PIs with elements, but only at the cost of breaking everything,
all agreeing on work differently, and reinventing them. 

Rick Jelliffe


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.