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

Searching a string for partial match; like vb InString

Subject: Searching a string for partial match; like vb InString or sql LIKE
From: Bill Shaw - EBCX <BillShaw@xxxxxxxxxxxxxxxxx>
Date: Mon, 6 Aug 2001 10:03:49 -0700
vb instring
I am trying to search any portion of the value of a node in an XML file for
a match with a param passed. I am finding when I use the "contains()"
function I have to have an exact match for it to work.  How do I search
string for a match in any portion.... Say I wanted to match any school with
the word "High" in the "school_name".  (Similar to the vb function of
InString or sql's LIKE %High%

In the example below, it does not work with partial name.

I have an xml file similar to:

<school>
	<school_name>Adams High</school_name>
</school>



I have a the following xsl

<xsl:param name="xName" select='"Adam"'/>

	<xsl:template match="/">
		<xsl:apply-templates select="//school[contains($xName,
school_name)]"/>
	</xsl:template>

	<xsl:template match="//school">
		<xsl:value-of select="school_name"/>
	</xsl:template>


Thanks for all help !!!!!!!  :)

Thanks,
 
Bill Shaw
eGov Web Solutions Team
301 W. Jefferson, Suite 400
Phoenix, AZ 85003-2157
 
PH 602-506-7919     FAX 602-506-5864
 
http://www.maricopa.gov

 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.