![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - use contains to search through multiple nodes. >Thread Next - Re: use contains to search through multiple nodes. Re: use contains to search through multiple nodes.To: NULL Date: 3/17/2008 4:27:00 PM Guoqi Zheng wrote: > I need to search keyword on <title>, also need to check <category> = > certain value. > I use below XSLT to search title node, how do I check <category> node > match one value? should I use apply-templates twice or is there other > solutions? You can use a predicate e.g. > <xsl:apply-templates > select="/agendas/agenda/data/content[contains(translate(.,$UC,$lc), > $Keyword)]"> <xsl:apply-templates select="/agendas/agenda[category = $category]/data/content[contains(translate(.,$UC,$lc), $Keyword)]"> that filters out the agenda elements having a category child element with content being equal to the variable or parameter named 'category'. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
