W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > November 2007

Re: XPath version

From: Alex Milowski <alex@milowski.org>
Date: Mon, 12 Nov 2007 10:08:00 -0800
Message-ID: <28d56ece0711121008i48c2ada7l2c2b840677a4c4cf@mail.gmail.com>
To: public-xml-processing-model-wg@w3.org

On 11/9/07, Jeni Tennison <jeni@jenitennison.com> wrote:
>
> Bearing in mind that all options are strings:
>
> <p:xslt>
>    <p:input name="source" select="/database/record[position() = $index]">
>      <p:pipe step="pipe" port="source" />
>    </p:input>
>    ...
> </p:xslt>
>
> Of course you could say that options were xs:untypedAtomic instead; at
> least that would make them castable. Then the only problem would come if
> you actively created a string using something like:
>
> <p:xslt>
>    ...
>    <p:param name="monthName"
>      select="/months/month[position() = substring($date, 6, 2)]">
>      <p:document href="months.xml" />
>    </p:param>
>    ...
> </p:xslt>

Wrapping the right-hand side in a number() function call would fix
this for XPath 2.0
while keeping XPath 1.0 compatible.

-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics
Received on Monday, 12 November 2007 18:08:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:54 GMT