CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: XSL Sort

Threaded View

  1. #1
    Join Date
    Mar 2004
    Posts
    20

    XSL Sort not working

    Hi,

    I am programming a DB in Access and looking to display my data with the XSL stylesheet.I am unable to display the contents of the DB, and I strongly suspect this to be a problem with thexsl stylesheet, since my xml island is coming out well without any problem. The first sort function sorts the attributes according to the tag "attrno" (which represents the display order ) to form the table headers.

    The second and third sort functions are intended to use multiple sort.
    I have enclosed the xsl stylesheet, could sombody pleeeease help?

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <table border="1">
    <TR bgcolor="beige" onMouseOver="this.bgColor='papayawhip';" onMouseOut="this.bgColor='beige';">
    <tr>
    <xsl:for-each select="root/header/headerinfo"> <!-- 1st tree-->
    <xsl:sort select="attrno"/>
    <td><xsl:value-of select="attribute"/></td>
    </xsl:for-each>
    </tr>
    </TR>

    <TR>
    <xsl:for-each select="root/row/attributes"> <!--2nd tree-->
    <xsl:sort select="PCB"/>
    <xsl:sort select="attrno"/>
    <td><xsl:value-of select="Value"/></td><!-- after sorting acc. to PCB and then acc to attrno, display the contents-->
    </xsl:for-each>
    </TR>

    </table>
    </xsl:template>
    </xsl:stylesheet>
    Last edited by erin; March 2nd, 2004 at 02:22 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured