Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<tbody>
             <xsl:for-each select="/M2:Cards/M2:SalesUnit/M2:NonGlobalCards/M2:Card" >
               <tr>
                 <td>
                   <asp:CheckBox ID="cb_Non{M2:Name}"    runat="server"/>
                 </td>
                 <td >
                   <xsl:value-of select="./M2:Name"/>
                 </td>
                 <td class="no_border">
                   <asp:TextBox ID="txt_NonMerchantNo{M2:Name}" CssClass="text_medium" MaxLength="17" Enabled="false" runat="server" onkeypress="return checkStringNumber(event,this);"></asp:TextBox>
                 </td>
                 <td>
                   <xsl:choose>
                     <xsl:when test="count(./M2:Options[@Display = 'dropdown']) > 0">
                       <asp:DropDownList ID="ddl_NonClearanceInd{M2:Name}" Enabled="false" runat="server">
                         <xsl:for-each select="./M2:Options/M2:Option[@Name = 'CardName']">
                           <asp:ListItem Value="{@ProviderName}">
                             <xsl:value-of select="."/>
                           </asp:ListItem>
                         </xsl:for-each>
                       </asp:DropDownList>
                     </xsl:when>
                     <xsl:otherwise>
                       <asp:label id="lbl_NonClearanceInd{M2:Name}" runat="server" text="{./M2:Options/M2:Option[@Name = 'CardName']/@ProviderName}" ></asp:label>
                     </xsl:otherwise>
                   </xsl:choose>
                 </td>
                 <xsl:if test="/M2:Cards/M2:SalesUnit/M2:NonGlobalCards/M2:Card[@CardID='5006']">
                   <td class="no_border">
                     <asp:TextBox ID="txt_Rate{M2:Name}" CssClass="text_medium" MaxLength="17" Enabled="true" runat="server" Text="2.75%" onkeypress="return checkStringNumber(event,this);"></asp:TextBox>
                   </td>
                 </xsl:if>
               </tr>
             </xsl:for-each>

           </tbody>
Posted
Comments
Thanks7872 20-Sep-13 2:25am    
I think its not working means even you your self not clear whether its working or not? I strongly recommend you to first read the guidelines before posting question here.
Naresh1277 20-Sep-13 6:10am    
i am sure about it.. the xsl:if statement is not working.. i want to know whether i have written xsl:if condition correctly or not

1 solution

The syntax of your if condition is correct, but your test path is probably not what you want. Remember that your if condition is nested inside a for-each, so your current context node will be a Card. I'm guessing you want this:
XML
<xsl:if test="@CardID='5006'"></xsl:if>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900