|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Re: problem with xsl:if test statement
Don't use for-each, but apply-templates, and qualify your selection with [1]. -----Original Message----- From: Amy Huang [mailto:h.amy88@xxxxxxxxx] Sent: Tuesday, December 18, 2007 9:22 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








