[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Well-established uses of processing instructions?
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|