This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Accessing array variable
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Accessing array variable
- From: Goetz Bock <bock at blacknet dot de>
- Date: Tue, 12 Jun 2001 19:32:35 +0200
- References: <F273cew8k69RKLpgTFu0000467b@hotmail.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
On Tue, Jun 12 '01 at 11:54, Andy Srinivasan wrote:
> I am trying to convert XML-XML.I have declared a array variable called
> benefit
> <xsl:variable name="benefit">
> <period ID='12M'>1</period>
> <period ID='18M'>2</period>
> <period ID='24M'>3</period>
> <period ID='2Y'>4</period>
> <period ID='5Y'>5</period>
> </xsl:variable>
>
>
> timePeriod="<xsl:value-of select="benefit/period[@ID =$BP] "/>" </xsl:if>
> [ ... ]
> What could be the reason for this?
It does not work this way.
I assume you define the array in your XSL-T styiesheet? If yes, try it
this way:
<xsl:stylesheet xmlns:local="data local to this file" ...>
<local:benefit>
<local:period ID='12M'>1</local:period>
...
</local:benefit>
.
.
.
<xsl:value-of select="document()/local:benefit/period[@ID=$BP]" />
.
.
.
</xsl:stylecheet>
I'm sorry if the syntax turnes out to be not quite correct, but I dont
have any XSL-T documentation in reach.
Goetz.
PGP signature