Re: [xsl] XPath 2.0 Datatypes namespace

Subject: Re: [xsl] XPath 2.0 Datatypes namespace
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 04 Aug 2006 15:17:04 +0100
>>>>> "tom" == tom tom <tomxsllist@xxxxxxxxxxx> writes:

    tom> My confusion was that I couldn't understand why I have to
    tom> specify the type here yet not for a string, eg:

    tom> translate('ab-c', '-', '/')

but you are supplying the type - the apostrophes indicate that the
data between them is typed as a string.

See XPath 2.0 section 17.1.1:

"The value of a string literal is an atomic value whose type is
xs:string and whose value is the string denoted by the characters
between the delimiting apostrophes or quotation marks. If the literal
is delimited by apostrophes, two adjacent apostrophes within the
literal are interpreted as a single apostrophe. Similarly, if the
literal is delimited by quotation marks, two adjacent quotation marks
within the literal are interpreted as one quotation mark."

So 'ab-c' is syntatically equal to xs:string ("ab-c").
-- 
Colin Adams
Preston Lancashire

Current Thread