Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Search XML node

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 5/3/2005 4:50:00 PM

thomas wrote:

> I'm building a guitar website which uses XML and XSLT. 
> http://www.madtim67.com/guitar/index.html You can search either by artist or 
> song. At the moment my XSL page only returns a result if the exact string is 
> entered i.e I have to enter 'baker street' or 'gerry rafferty' in order to 
> get a result. I would appriciate it if anyone could tell me how to modify 
> the code below so that if I enter 'baker' or 'gerry' I would get a result.

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

>      <xsl:for-each select="cat/links">
>  <xsl:if test="./artist = $text1">

You can use the different functions XPath offers for strings e.g.
   <xsl:if test="contains(artist, $text1)">
see
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmrefstringfunctions.asp>

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent