xsl-list
[Top] [All Lists]

RE: [xsl] Getting an error with a variable

2006-07-28 22:01:31
Thanks for your help, worked great.

I have another question.

I'm wanting to combine 2 xml files. One has a list of car number and
competitor names, the other is a list of times. Essentially a relational
database. I use .asp to pass the xml and xsl files. Is it possible to pass 2
xml files, or how can I access the data from the 2nd xml file. Could you
point me to some documentation. I havent been able to find anything.

Thanks
Garry

-----Original Message-----
From: David Carlisle [mailto:davidc(_at_)nag(_dot_)co(_dot_)uk]
Sent: Friday, 28 July 2006 8:23 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Getting an error with a variable



variable bindings are in scope just for the element that contains your
binding, so in your case it is only in scope within the xsl:for-each.
So it's already gone out of scope outside the xsl:when clause.

Also it is a lot more efficient to use the form

<xsl:variable name="sNum" select="@no"/>

as that binds sNum to the attribute whereas

              <xsl:variable name="sNum">
                <xsl:value-of select="@no"/>
              </xsl:variable>
makes a new root node with child a text node with string value the
string value of the attribute.


I think you want the h2 element to contain the @no attribute if
0=$paramVal4
and $paramVal2 otherwise, in which case no variables are needed:

<h2>
<xsl:value-of select="$paramVal2[not(0=$paramVal4)]
                      |
                       /stages[0=$paramVal4]/competition/itinerary/stage[1]/
@no" />
</h2>


David

--~------------------------------------------------------------------
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>
--~--