[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: determine the number of payment methods and specif
Hi,
Sorry...first time in posting here...ok, so here's an amended version of the XSL: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml"> ... <xsl:template name="checkOutProgressStep"> <xsl:param name="label"/> <xsl:variable name="noOfNodes" select="count(/order/paymentMethods/*)" /> <xsl:choose> <xsl:when test="$noOfNodes = '3'"><!-- check for 3 elements --> <xsl:choose> <xsl:when test="$label = 'directDebit'"> <li class="doubleLine current">Payment by <br/>Direct Debit</li> <li class="doubleLine">Payment by <br/>Credit Card</li> <li class="doubleLine">Payment by <br/>Invoice</li> </xsl:when> <xsl:when test="$label = 'creditCard'"> <li class="doubleLine completed">Payment by <br/>Direct Debit</li> <li class="doubleLine current">Payment by <br/>Credit Card</li> <li class="doubleLine">Payment by <br/>Invoice</li> </xsl:when> <xsl:when test="$label = 'invoice'"> <li class="doubleLine completed">Payment by <br/>Direct Debit</li> <li class="doubleLine completed">Payment by <br/>Credit Card</li> <li class="doubleLine current">Payment by <br/>Invoice</li> </xsl:when> </xsl:choose> </xsl:when> </xsl:choose> </xsl:template> ... </xsl:stylesheet> You'll notice that for the current payment method (specified in the xsl:when test="..."), the class "current" is added. If a payment method exists before the current one, then this will have a class "completed", whereas any subsequent to the current matching payment will have no extra class. The method above is only for checking if all three payment types are present. I haven't even approached checking for 2 payment types or 1, as I don't even know where to begin. Apologies if this confusing, as I've been staring at it all day, and appreciate any tips on bug fixing.
|
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
|