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

How do you specify multiple attributes when using for-

Subject: How do you specify multiple attributes when using for-each?
From: Kathryn.Grant@xxxxxxxxxxxxxxxxx
Date: Fri, 26 Jul 2002 16:52:12 -0700
coderec
Hi all,

Here's a snippet from a simple xml file, which contains records for the US,
Canada, and Mexico:

<statecodes>
   <coderec country="us">
      <descr>ALABAMA</descr>
      <code>AL</code>
      <tndm_code>AL</tndm_code>
      <nbr>01</nbr>
   </coderec>
   <coderec country="us">
      <descr>ALASKA</descr>
      <code>AK</code>
      <tndm_code>AK</tndm_code>
      <nbr>02</nbr>
   </coderec><coderec country="canada">
      <descr>SASKATCHEWAN</descr>
      <code>SK</code>
      <tndm_code>SW</tndm_code>
      <nbr>59</nbr>
   </coderec>
   <coderec country="mex">
      <descr>TLAXCALA</descr>
      <code>TL</code>
      <tndm_code>TL</tndm_code>
      <nbr>NA</nbr>
   </coderec>
</statecodes>

I have an XSL style sheet that selects only US records with the following
for-each statement.

   <xsl:for-each select="//statecodes/coderec[@country='us']">

Now I need to create a new transformation that selects both US and Canadian
records.  I have been looking for several hours for the way to specify
multiple attributes, but have been unsuccessful.  I tried

   <xsl:for-each select="//statecodes/coderec[@country='us' | 'canada']">

thinking that a Boolean "or" might work--but it didn't.  Any help would be
appreciated!

Kathryn

 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.