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

Is there any benefit to creating a variable and speci

Subject: Is there any benefit to creating a variable and specifying as="xs:string"?
From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 9 Jun 2024 09:18:47 -0000
 Is there any benefit to creating a variable and  speci
Hi Folks,

I have this xsl:param at the top of my XSLT program:

<xsl:param name="ICAO" />

Is there any benefit to adding this "as" clause:

<xsl:param name="ICAO" as="xs:string"/>

That "as" clause says the ICAO param is a string value. Well, everything is a
string. These are all strings -- '123', 'true', 'http://www.example.com',
'01101' -- all of which should not be used to populate the ICAO param. It
seems to me that adding the "as" clause provides zero benefits. In fact, it
has disadvantages: it makes the code more verbose, it requires more typing. Do
you agree that adding the "as" clause provides no benefits?

Bonus question: The value to populate the ICAO param should be a 4-letter,
uppercase value, such as KBOS. Is there anyway to express that
requirement/constraint in the "as" clause?

/Roger

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.