Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Search XML node [Thread Next] Re: Search XML nodeTo: 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/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
