Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: use contains to search through multiple nodes.

From: "Guoqi Zheng" <no@-----.--->
To: NULL
Date: 3/18/2008 12:13:00 AM

Great! what about if the category node is under the node of <metadata> 
instead of directly under<agenda>? The agenda data can be something like

-------------------------------------- 
<agenda>
<id>1112</id>
<data>
<content>
<title>this is the title # 2</title>
</content>
<ref>GT355-332-234</ref>
</data>
<metadata>
<category>Finance</category>
</metadata>
</agenda>

-----------------------------

What should I do in this case then?

Thanks for great help.

Regards,

Guoqi Zheng


"Martin Honnen" <mahotrash@y...> дÈëÏûÏ¢ 
news:uBRvLNEiIHA.2304@T......
> 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/ 



transparent
Print
Mail
Digg
delicious
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