Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to write a for loop in xslt:
XML
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>

  <xsl:template name="DYSAVRINDATA">
    <xsl:param name="ReportType" />


    <BR></BR>
    <p class="tagname">
      <xsl:text>AVR DATA</xsl:text>
    </p>
    <TABLE BORDER="1" class="sample" >
      <TR  class="header">
        <xsl:for-each select="TITLES/*">
          <TD>
            <xsl:value-of select="."/>
          </TD>
        </xsl:for-each>
      </TR>
      <xsl:for-each select="DYSAVRINDATAROWS_DATA/ROWDATA">
        <xsl:choose>
          <xsl:when test="$ReportType = 1">
            <TR class="datacellone">
              <xsl:variable name="childnodes" select="*"/>
              <!--all children-->
              <xsl:for-each select="$childnodes">
                <TD>

                  <xsl:value-of select="."/>

                </TD>
              </xsl:for-each>
            </TR>
          </xsl:when>
          <xsl:otherwise>
            <xsl:for-each select="CASE_NO">
              <tr>
                <xsl:attribute name="bgcolor">
                  <xsl:call-template name="color">
                    <xsl:with-param name="ref">
                      <xsl:value-of select="@ref" />
                    </xsl:with-param>
                  </xsl:call-template>
                </xsl:attribute>
                <!--<TD>
                      <xsl:value-of select="@id" />
                    </TD>-->
                <xsl:variable name="childnodes" select="*"/>
                <xsl:for-each select="$childnodes">
                  <TD >
                    <xsl:value-of select="."/>
                  </TD>
                </xsl:for-each>
              </tr>
            </xsl:for-each>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
      <xsl:apply-templates/>
    </TABLE>
  </xsl:template>
</xsl:stylesheet>


modify and give me
Posted
Comments
Sergey Alexandrovich Kryukov 26-Jul-13 0:52am    
No piece of code can be fixed without knowing of what it is supposed to do.
—SA

1 solution

i want to change the titles as per my requirement
 
Share this answer
 
Comments
Tejas Vaishnav 26-Jul-13 1:18am    
please use improve question opetion if you need to add any more details to your question

OR

use have a question or comment? option to add your comments regarding anything else.

but please do not post a comments as solution.

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