Re: [xsl] Only child test

Subject: Re: [xsl] Only child test
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Thu, 10 Oct 2013 15:40:40 +0100
> But my approach to programming is like a science experiment: try to make
> as clear as possible what is done and why, on the grounds that it will
> need not be changed later. This is not a mathematician's approach, who
> will prove it correct (for the stated requirements and conditions at the
> time) and move on with life :-)
>

A complication here is the use of programming idioms. An example in XPath 2.0
is

(@status, 0)[1]

For someone who hasn't encountered it before, this is obscure and perverse.
For someone who has a few months of XPath 2.0 experience, it is the most
natural way in the world of saying "the value of the status attribute,
defaulting to 0 if absent".

Michael Kay
Saxonica

Current Thread