W3C home > Mailing lists > Public > public-qt-comments@w3.org > July 2003

RE: MS-FO-LC1-036: string-join example is wrong

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Tue, 1 Jul 2003 19:50:47 +0200
Message-ID: <DFF2AC9E3583D511A21F0008C7E62106073DCF9B@daemsg02.software-ag.de>
To: Jeni Tennison <jeni@jenitennison.com>, Michael Rys <mrys@microsoft.com>
Cc: public-qt-comments@w3.org

> 
> The example is wrong, however, because it uses the expression 
> "name(.)" when it should use "name($n)". The current example 
> would return "section/section/section" since "name(.)" always 
> returns "section". The corrected example is:
> 
>   fn:string-join(for $n in ancestor-or-self::* return name($n), '/')
> 

If we can't have a "for" expression that binds the context item, I really do
think that as a minimum, a "for" expression should unbind ".", so that this
all-too-common error gets detected.

Michael Kay
Received on Tuesday, 1 July 2003 13:51:06 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:13 UTC