[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

Subject: Re: determine the number of payment methods and specify order depending on page type being viewed
From: Caroline Umali <carolineumali@xxxxxxxxx>
Date: Tue, 04 Nov 2008 00:09:18 +0000
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.

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.