Re: Processing instructions

On 26/07/2012 10:51, Dave Pawson wrote:
> Is there any reason you could not use elements and attributes for
> these purposes George?

The usual reason given is schema validity but another reason is general
xml processing. If you have a working xslt stylesheet on some document
and then you litter the source document with empty elements tracking
diff changes thenchances are the stylesheet will stop working:
any xpath going ....*[1] will pick up the wrong element.
whereas if you mark it with PIs then on a good day this won't affect
the stylesheet and PIs will be ignored except for templates specifically
looking for the diff markup.

Of course it is possible to use an xpath like node()[1]....which would
be affected by insertion of PIs but this is a lot less likely and much
easier to avoid.


That doesn't necessarily mean that mico-xml should keep PIs, just that
saying "you can replace PIs with empty elements" over simplifies the
case against them.

Actually I am less convinced that the xml-stylesheet PI is a good
argument for keeping them. The intention here is presumably to link to
an XSLT stylesheet and presumably XSLT will be full XML so this is only
of use to micro-xml consumers that also have a full XML processing stack
available. I think the argument is that the authoring environment can
use the simpler micro-xml setup even though the rendering environment
needs a full XML stack, so it's not completely useless, but not the
strongest argument in favour of PIs in XML.

David


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Received on Thursday, 26 July 2012 10:27:22 UTC