This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Check if a field matches "any" of a set of other entries
- To: XSL-List at mulberrytech dot com
- Subject: Check if a field matches "any" of a set of other entries
- From: Gerard Berthet <gberthet at xmlnetworks dot com>
- Date: Wed, 03 May 2000 01:37:34 -0700
- Reply-To: xsl-list at mulberrytech dot com
How can I check if a value matches any of a set of other values?
Here is an example XML:
<document>
<references>
<ref>a</ref>
<ref>b</ref>
<ref>c</ref>
</references>
<data>
<entry>x</entry>
<entry>b</entry>
<entry>a</entry>
<entry>z</entry>
</data>
</document>
I want to print each entry in bold if it exists in the
list of references, otherwise I want to print it in italics.
Here is my pseudo-xml code:
<xsl:for-each select="/document/data/entry">
if entry/text() equals any of the values in <references>
set flag=true;
</xsl:for-each>
<xsl:if test(flag is true)>
print the value in bold
otherwise
print the value in italics
</xsl:if>
Can I do that in XSL?
Gerard Berthet
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list