[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] xsl:for-each immediately followed by xsl: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) >= number($paramLoRec)) and (number(record_num) <= 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|