xsl-list
[Top] [All Lists]

RE: [xsl] casting sequences

2009-01-07 17:45:06

for $t in tokenize() return xs:dayTimeDuration($t)

Tedious - some of us tried very hard to get a "simple mapping operator" that
would do this without needing a variable - but the attempt floundered.

Michael Kay
http://www.saxonica.com/
 

-----Original Message-----
From: Henry S. Thompson [mailto:ht(_at_)inf(_dot_)ed(_dot_)ac(_dot_)uk] 
Sent: 07 January 2009 15:46
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] casting sequences

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have input like this:

  . . .
  <topics days="P1D P4D">
  . . .

and in order to get a sequence of dayTimeDurations, which is 
what I want, I've had to write

  <xsl:variable name="days" select="tokenize(//topics/@days,' ')"/>
  <xsl:variable name="ds"
        
select="(xs:dayTimeDuration($days[1]),xs:dayTimeDuration($days[2]))"/>

This is not only tedious, it only works if I know in advance 
how many days there will be, which in principle I don't.  
What's the right way to do this?  I spent rather a long time 
searching the documentation without success. . .

ht
- -- 
       Henry S. Thompson, School of Informatics, University 
of Edinburgh
                         Half-time member of W3C Team
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 
131 650-4440
                Fax: (44) 131 651-1426, e-mail: 
ht(_at_)inf(_dot_)ed(_dot_)ac(_dot_)uk
                       URL: http://www.ltg.ed.ac.uk/~ht/ 
[mail really from me _always_ has this .sig -- mail without 
it is forged spam] -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFJZM5JkjnJixAXWBoRAvFQAJ42q/gItDozDIIzjyMTkF9wm5fChACeJFHj
/pMc5wWWsGXOmRJO74ROgsg=
=Krd7
-----END PGP SIGNATURE-----

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>