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

RE: Re: problem with xsl:if test statement

Subject: RE: Re: problem with xsl:if test statement
From: "Nassar, Anthony" <ANassar@xxxxxxxx>
Date: Wed, 19 Dec 2007 14:37:07 -0500
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

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.