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

Re: Does XSL have arrays?

Subject: Re: Does XSL have arrays?
From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 4 Jan 2001 18:09:34 +0100 (MET)
data array xslt
> > How about using a chunk of XML as your 'array'?
> 
> That's why I said XSLT 1.1 will have 'arrays'.
> XSLT 1.0 doesn't, except by way of vendor-specific extension functions.
Well, XSLT 1.0 already has this facility:

<xsl:stylesheet version="1.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:data="urn:data-section"
		exclude-result-prefixes="data">

<data:month name="Jan" days="0" />
<data:month name="Feb" days="31" />
<data:month name="Mar" days="59" />
<data:month name="Apr" days="90" />
<data:month name="May" days="120" />
<data:month name="Jun" days="151" />
<data:month name="Jul" days="181" />
<data:month name="Aug" days="212" />
<data:month name="Sep" days="243" />
<data:month name="Oct" days="273" />
<data:month name="Nov" days="304" />
<data:month name="Dec" days="334" />

<xsl:template match="/">
   Days since January, 1.:
   <xsl:value-of select="document('')/*/data:month[@name='Jan']/@days +
			 4" />
   <!-- +4, because today is the fourth -->
   or, if you have the number of the month
   <xsl:value-of select="document('')/*/data:month[1]/@days + 4" />
</xsl:template>

</xsl:stylesheet>

Cheers,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.