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

RE: Passing in parameter used in matching

Subject: RE: Passing in parameter used in matching
From: "Eric Wallet" <eric.wallet@xxxxxxxxxxx>
Date: Thu, 18 Oct 2001 16:00:14 +0200
eric wallet
hello,

i think the probleme is that the path to you're test is :
ReturnResultSet/LoanSearchSet/Loan/LoanBorrowerSet/Borrower[contains(LastNam
e,
$nameSearchValue)]\">

this is a complete path, refering to the root.
so the xsl is probably always catching the first xml value : Smith

Why don't you try to match on root with a first template and then call a
second template wich match on
<LastName> ?

something like :
<xsl:param name="nameSearchValue">
</xsl:param>

<xsl:template match="/">
	<xsl:apply-template
match="ReturnResultSet/LoanSearchSet/Loan/LoanBorrowerSet/Borrower"/>
</xsl:template>

<xsl:template match="Borrower[contains(LastName, $nameSearchValue)]>
	<!-- Here are the actions to do -->
</xsl:template>

i didn't try it yet, but i think it should work.
see u.
eric

-----Message d'origine-----
De : owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]De la part de Katie
McNally
Envoyé : jeudi 18 octobre 2001 15:00
À : xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Objet :  Passing in parameter used in matching


One of my pages has a field that allows the user to enter a last name and
then click the "search" button.  The results should display all loans that
have a borrower with a last name that matches the criteria entered by the
user (partial match).  The name entered by the user is passed as a parameter
to the XSL stylesheet.  With the XSL below, the "No results were found" is
displayed on the search results page, even when I enter a name (or partial
name) that matches one of the borrower's last names in the XML.  What am I
doing wrong?

XSL:

<xsl:param name="nameSearchValue">
</xsl:param>

<xsl:template match='/'>

<xsl:choose>
<xsl:when
test=\"ReturnResultSet/LoanSearchSet/Loan/LoanBorrowerSet/Borrower[contains(
LastName,
$nameSearchValue)]\">

...xsl here creates table of loans with borrower last name matching
criteria...

</xsl:when>
<xsl:otherwise>
<xsl:text>No results were found.</xsl:text>
</xsl:otherwise>
</xsl:choose>

</xsl:template>


XML:

<ReturnResultSet>
	<LoanSearchSet>
		<Loan>
			<LoanNumber>123</LoanNumber>
			<LoanBorrowerSet>
				<Borrower>
					<LastName>Smith</LastName>
				</Borrower>
			</LoanBorrowerSet>
		</Loan>
		<Loan>
			<LoanNumber>456</LoanNumber>
			<LoanBorrowerSet>
				<Borrower>
					<LastName>Jones</LastName>
				</Borrower>
			</LoanBorrowerSet>
		</Loan>
		<Loan>
			<LoanNumber>789</LoanNumber>
			<LoanBorrowerSet>
				<Borrower>
					<LastName>Stills</LastName>
				</Borrower>
			</LoanBorrowerSet>
		</Loan>
		...
	</LoanSearchSet>
</ReturnResultSet>

Thanks,
Katie

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


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

 
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif



 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.