[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
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
|
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
|