Don't use for-each, but apply-templates, and qualify your selection with
[1].
-----Original Message-----
From: Amy Huang [mailto:h(_dot_)amy88(_at_)yahoo(_dot_)com]
Sent: Tuesday, December 18, 2007 9:22 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Re:[xsl] problem with xsl:if test statement
I got the solution from another list (I posted my question last week. I
thought I wouldn't get a reply. Next time I'll wait a few more days).
I'll post the solution here so it might be of help to others.
Use single quotes for the parameter.
<xsl:param name="Country" select="'Mexico'" />
Change the for-each with:
<xsl:if test="Products/Fruits[Country = $Country and Type = 'Apples']">
I'm new to xml and xsl. I need to generate one link if my query finds
one or more records in my XML document. But I if I use "for each
statement", the link will repeat again and again depending on how many
records satisfy my query. E.g., if 2 records satisfy my query, the link
will repeat twice like this:
For apples, click here
For apples, click here
How can I generate only one link if my query finds more than one
records?
Amy
________________________________________________________________________
____________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
--~------------------------------------------------------------------
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>
--~--