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

RE: Accessing array variable

Subject: RE: Accessing array variable
From: "Jason Macki" <jmacki@xxxxxxx>
Date: Tue, 12 Jun 2001 15:46:16 -0500
jason array
Hello,

I think that the problem with the value-of element in the original code
was that you didn't identify "benefit" as a variable using XPATH.  

The following searches the context node for a child node "benefit" which
has a child node "period" with an "ID" attribute equal to the variable
"BP":

<xsl:value-of select="benefit/period[@ID =$BP] "/>

You must identify "benefit" as a variable with a dollar sign, as you did
with "BP":

<xsl:value-of select="$benefit/period[@ID =$BP] "/>

- Jason

-----Original Message-----
From: Andy Srinivasan [mailto:sriandy74@xxxxxxxxxxx]
Sent: Tuesday, June 12, 2001 3:22 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Accessing array variable


Hi!Goetz,

I tried yr method but it say illegal arguments for document().
I removed document and tried, I jus get a blnk value for timePeriod.

Anand


>From: Goetz Bock <bock@xxxxxxxxxxx>
>Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>Subject: Re:  Accessing array variable
>Date: Tue, 12 Jun 2001 19:32:35 +0200
>
>
>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.
><< attach3 >>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


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


 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.