[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Check if a field matches "any" of a set of other entries

Subject: Check if a field matches "any" of a set of other entries
From: Gerard Berthet <gberthet@xxxxxxxxxxxxxxx>
Date: Wed, 03 May 2000 01:37:34 -0700
xsl set flag
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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.