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

xsl:for-each immediately followed by xsl:if

Subject: xsl:for-each immediately followed by xsl:if
From: "Mike Bandy" <michael.bandy@xxxxxxxxxxxxx>
Date: Fri, 1 Feb 2002 09:50:40 -0500
xsl for each if
The faq says not to immediately follow an xsl:for-each with an xsl:if.  How
do I merge these into one statement?

Another newbie question - can I depend on the order of the tags and
attributes being delivered to my stylesheet in the same order as they were
listed in the XML file?  So a for-each runs through the entries in a
deterministic order or do I always have to sort first?

Thanks.

	Mike Bandy

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

        <xsl:for-each select="record">
          <!-- Get the record number and test if we're in the requested
range -->
          <!-- Process this record if:
		    1) record_num tag doesn't exist
		 or 2) $paramLoRec is -1
		 or 3) record_num between $paramLoRec and $paramHiRec -->
          <xsl:if
              test="( ( not (record_num) )
			or ( number($paramLoRec) = -1 )
			or ( (number(record_num) &gt;= number($paramLoRec))
			  and (number(record_num) &lt;= number($paramHiRec)) )
		    )">
            <!-- Process the record element -->
            <tr>
              <xsl:call-template name="do_data_row">
                <xsl:with-param name="fields" select="$fields"/>
              </xsl:call-template>
            </tr>
          </xsl:if>
        </xsl:for-each>




 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.