Re: [xsl] Parameter of type xs:anyURI

Subject: Re: [xsl] Parameter of type xs:anyURI
From: Martynas Jusevicius <martynas.jusevicius@xxxxxxxxx>
Date: Tue, 24 Aug 2010 15:06:59 +0200
So what do I do? Just change the parameter type to xs:string?

On Tue, Aug 24, 2010 at 3:04 PM, David Carlisle <davidc@xxxxxxxxx> wrote:
> On 24/08/2010 14:01, Martynas Jusevicius wrote:
>>
>> Hey list,
>>
>> I don't get how to define a parameter of type xs:anyURI. I try it like
>> this:
>>
>> <xsl:param name="base-uri" select="'http://www.google.com'"
>> as="xs:anyURI"/>
>>
>> But Saxon 9 gives me an error:
>> "Error at xsl:param on ...:
>> XTTE0600: Required item type of value of parameter $base-uri is
>> xs:anyURI; supplied value has item type xs:string"
>>
>> Do I always have to cast a string value with xs:anyURI()?
>> What if I pass the value from Java, do I need 2 parameters then -- one
>> for the string value, and the other one casted as xs:anyURI?
>>
>
> most command line processors (including saxon) only let you do strings
> valued parameters  on the command line but from the java api you can build
> arbitrary XDM objects and pass them in. Of course in the case of anyURI
> there isn't really much difference as the only difference between that and
> string is its name, so its simpler just to use strings.
> (which is why the core xpath functions that you might expect to take uri
> just take string values)
>
>
> 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.
> ________________________________________________________________________

Current Thread