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

Re: passing a sequence as a parameter

Subject: Re: passing a sequence as a parameter
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 26 Feb 2008 15:42:30 +0000
Re:  passing a sequence as a parameter
On 26/02/2008, Colin Adams <colinpauladams@xxxxxxxxxxxxxx> wrote:
> On 26/02/2008, David Carlisle <davidc@xxxxxxxxx> wrote:
>
>  >  Actually I didn't understand Colin's statement that you couldn't use as=
>  >  in this context, Colin, did you mean that was a restriction in the
>  >  language or just of gesalt?
>
>
> Both.
>
>  That is, the language doesn't allow you to specify a type of two
>  booleans followed by an integer, for example.
>
>  But you could do this via a user-defined type in a schema-aware
>  processor. And Gestalt is not schema-aware.

Even with a schema-aware processor you couldn't pass a pre-typed
atomic sequence as a parameter could you?  You could pass elements
that were typed, but not atomics?  Maybe an example would help.

A way around it is to pass in a delimited string and the create the
sequence yourself:

<xsl:param name="str" select="'foo, 1'" as="xs:string"/>

<xsl:variable name="input">
	<xsl:variable name="tokens" select="tokenize($str, ',')"/>	
	<xsl:sequence select="(xs:string($tokens[1]), xs:integer($tokens[2]))"/>
</xsl:variable>


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.