Joris Gillis wrote:
> <xsl:template name="foo">
> <xsl
aram name="bar">
> <xsl:value-of select="$array[@ref=$bar]"/>
> </xsl:template>
I am trying a variation on what both you and Philippe Poulard suggested.
Basically what I am trying to do is store some calendar information as
a variable that I can use in some of my XSLT templates. I have created
the following variable:
<xsl:variable name="calendar_info">
<cal:month name="January">
<cal:abbrev>Jan</cal:abbrev>
<cal

rev>December</cal

rev>
<cal:next>Feburary</cal:next>
</cal:month>
<cal:month name="Feburary">
<cal:abbrev>Feb</cal:abbrev>
<cal

rev>January</cal

rev>
<cal:next>March</cal:next>
</cal:month>
<cal:month name="March">
<cal:abbrev>Mar</cal:abbrev>
<cal

rev>Feburary</cal

rev>
<cal:next>April</cal:next>
</cal:month>
<cal:month name="April">
<cal:abbrev>Apr</cal:abbrev>
<cal

rev>March</cal

rev>
<cal:next>May</cal:next>
</cal:month>
<cal:month name="May">
<cal:abbrev>May</cal:abbrev>
<cal

rev>April</cal

rev>
<cal:next>June</cal:next>
</cal:month>
<cal:month name="June">
<cal:abbrev>Jun</cal:abbrev>
<cal

rev>May</cal

rev>
<cal:next>July</cal:next>
</cal:month>
<cal:month name="July">
<cal:abbrev>Jul</cal:abbrev>
<cal

rev>June</cal

rev>
<cal:next>August</cal:next>
</cal:month>
<cal:month name="August">
<cal:abbrev>Aug</cal:abbrev>
<cal

rev>July</cal

rev>
<cal:next>September</cal:next>
</cal:month>
<cal:month name="September">
<cal:abbrev>Sep</cal:abbrev>
<cal

rev>August</cal

rev>
<cal:next>October</cal:next>
</cal:month>
<cal:month name="October">
<cal:abbrev>Oct</cal:abbrev>
<cal

rev>September</cal

rev>
<cal:next>November</cal:next>
</cal:month>
<cal:month name="November">
<cal:abbrev>Nov</cal:abbrev>
<cal

rev>October</cal

rev>
<cal:next>December</cal:next>
</cal:month>
<cal:month name="December">
<cal:abbrev>Dec</cal:abbrev>
<cal

rev>November</cal

rev>
<cal:next>January</cal:next>
</cal:month>
</xsl:variable>
My main goal right now is to find out the next month so that I can
iterate through a list of months. I figured while I was at it I would
put other information in the structure which might be useful for the
future. This variable is defined in a separate xsl file so that many xsl
templates can use the information. I now am trying to use the
information. So if I do
<xsl:value-of select="$calendar_info/cal:month[@name='January']/cal:abbrev/>
I get an error. I want this to return the abbreviated version of January
('Jan'). If I do
<xsl:value-of select="$calendar_info"/>
then I get all the content of the variable but how do I select the nodes
in the variable. Any help is greatly appreciated.
Thanks,
Eric