[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Is there any benefit to creating a variable and s

Subject: Re: Is there any benefit to creating a variable and specifying as="xs:string"?
From: "Michael Kay michaelkay90@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Jun 2024 06:06:36 -0000
Re:  Is there any benefit to creating a variable and  s
> On 17 Jun 2024, at 02:41, Dimitre Novatchev dnovatchev@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> >   >>
> >   >> That "as" clause says the ICAO param is a string value. Well,
everything is a string.
> >
> >   Nonsense. Saying as="xs:string" stops the caller from supplying (say) a
boolean, a number, or a map.
>
> I was under the impression that the quoted global parameter declaration was
for a value supplied on the command-line that invoked the XSLT processor:
>
> >            <xsl:param name="ICAO" as="xs:string"/>
>
> In this case Roger would be right that specifying the type as xs:string
would not be too-useful, or is this not so?
>

Yes, if it's only ever called from the Saxon command line, then specifying
as="xs:string" achieves very little. It does however prevent someone
supplying, say, an integer using the command line syntax ?ICAO=42, or a date
using ?ICAO=current-date(). It also has documentary value, and it will come
into its own if someone in the fullness of time attempts to invoke the
stylesheet using a different processor or a different API.

Michael Kay
Saxonica

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.