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

Re: Well-established uses of processing instructions?

  • To: Vladimir Gapeyev <vgapeyev@s...>
  • Subject: Re: Well-established uses of processing instructions?
  • From: Mark Wilkinson <kremvax@g...>
  • Date: Wed, 18 May 2005 10:54:15 +0100
  • Cc: xml-dev@l...
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hjQhqKaSmxjf3MYoTVIVOHKX40Xhuq/kzXfMQ4FM5TExqNd5pdOrecPgATCG5FltU+miSrHdc3nIifNhXTp09qVZFZxyy3QM3G1aNzFah/O5bByEgnc5T1D9lWPxF+0BsoLmAhhghaK9GMzqDr+orSPInAylWWPDZ+ao0IPwZGY=
  • In-reply-to: <Pine.GSO.4.58.0505081923130.20291@r...>
  • References: <Pine.GSO.4.58.0505081923130.20291@r...>
  • Reply-to: Mark Wilkinson <kremvax@g...>

instructions for uses
On 5/9/05, Vladimir Gapeyev <vgapeyev@s...> wrote:
> 
> I am curious to know to what uses have people put XML processing
> instructions.  I am more interested in those that have a "community"
> around them (manifesting itself by a de jure or a de facto standard, or
> multiple applications that understand the PI, or large amount of document
> instances with unrelated authorship) rather than in made-up samples,
> however plausible they are.  Any pointers?

I'm a bit late to the discussion, and my example doesn't have much of
a community around it yet as the code is still in development, but I'm
considering using processing instructions as a way of switching the
expression language syntax used in (yet another) scripting language
that uses XML as its syntax. The idea is that you can write something
like this:

    <c:out value="${name.length()}"/>
    <?script-el xpath ?>
    <c:out value="${/projects/project[@name = $project]}"/>
    <?script-el ognl ?>

I could probably have used plain elements instead of processing
instructions, but to me these are instructions to the software that is
parsing the script, not part of the script itself. I could also have
encoded the information into an attribute, but attributes have more of
a tree semantic - attaching an attribute to an element suggests that
it should apply to that node and all its children ('xmlns' probably
being the canonical example). I didn't think that using tree semantics
was the right approach.

Processing instructions seem like the right approach when you're
trying to express 'out-of-band' information like this, particularly
when it isn't directly linked to the tree structure of the document.
In my example the change of expression language is something that
applies from a point in the source text onwards, a concept that is
hard to express otherwise.

-Mark.

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.