XSL Display a Table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prao2005
    New Member
    • Sep 2009
    • 18

    XSL Display a Table

    Q) How to display all the records of a table using xsl?

    Solution applied -->
    Suppose a class "test" has an attribute "test1" which itself is a table. "test1"
    contains some a1, a2, a3 attributes. I need to display all rows based on the value of an attribute"a1"

    Code:
    <xsl:template name="rowCounter">
      <xsl:param name="N" />
      <tr>
        <xsl:if test="
          DBE:Attribute[@name='a1']/
          DBE:Object[@Class='test']/
          DBE:Attribute[@name='test1']/
          DBE:Table/
          DBE:TableRow[ $N ]
        "> 
          <xsl:for-each select="
            DBE:Attribute[@name='a1']/
            DBE:Object[@Class='test']/
            DBE:Attribute [@name='test1']/
            DBE:Table
          ">
            <td>          
              <xsl:apply-templates select="DBE:TableRow[ $N ]"/>
            </td>
            <xsl:text> </xsl:text>
          </xsl:for-each>
          <xsl:call-template name="rowCounter">
            <xsl:with-param name="N" select="$N + 1"/>
          </xsl:call-template>
        </xsl:if>
      </tr>
    </xsl:template>
    Is the above correct? How do I display values of a1, a2 and a3 for each a1?
    Last edited by Dormilich; Sep 14 '09, 10:57 AM. Reason: please use meaningful titles
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    Originally posted by prao2005
    Is the above correct?
    does it work?

    Originally posted by prao2005
    How do I display values of a1, a2 and a3 for each a1?
    by using loops.

    Comment

    • prao2005
      New Member
      • Sep 2009
      • 18

      #3
      Not printing values at present....

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        I’m fishing in the dark without the relevant XML/XSL.

        Comment

        Working...