2 Replies Latest reply: May 31, 2012 4:11 AM by 905160 RSS

    xsl tag issue

    905160
      Just want to compare the result of one tag is equal to 'US' then display value of <xsl:value-of select="Amount/Currency/Code" />
      else it has to display the value of <xsl:value-of select="Amount/Currency" />







      I am trying some thing like this...

      <xsl:if test="<xsl:value-of select="Address/2Digit"/> = 'US'>
      <xsl:value-of select="Amount/Currency/Code" />

      </xsl:if>

      if the 2digit country is not US then it has to display the value of the below tag
      <xsl:value-of select="Amount/Currency" />
        • 1. Re: xsl tag issue
          odie_63
          <xsl:value-of select="Address/2Digit"/>
          "2Digit" is not a valid XML name, is it a typo?

          Anyway, you can use <tt>xsl:choose</tt> element :
          <xsl:choose>
            <xsl:when test="Address/Digit='US'">
              <xsl:value-of select="Amount/Currency/Code" />
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="Amount/Currency" />
            </xsl:otherwise>
          </xsl:choose>
          {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
          • 2. Re: xsl tag issue
            905160
            Thanks, it worked...It was my typo mistake