Jump to content

Search the Community

Showing results for tags 'xsl:sort'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hi everybody, First post here, hoping someone can help. I'm looking for a way to specify a primary and secondary column to sort by in a table. For example, a list of people that are to be contacted in an emergency, some of whom are "Primary" contacts, and some who are "Alternate" contacts. What I want is for the primaries to be listed first, in alphabetical order, before any alternates, who are also listed alphabetically. (Primary and Alternate have also been assigned a numerical value, with Primary being 1 and Alternate being 2.) Currently, these table sort only on one node, the person's name, so I get: Type Name1. Primary Ben Smith2. Alternate David Willis2. Alternate Mary Jones1. Primary Robert Crane What I want is: Type Name1. Primary Ben Smith1. Primary Robert Crane2. Alternate David Willis2. Alternate Mary Jones The values are being pulled from database software where each field (i.e. "Type" or "Name") has a Field ID that the XSLT uses to populate the output document. Code looks like this right now: <table> <tbody> <tr> <th>Type</th> <th>Name</th> </tr> <xsl:for-each select="Record/Field[ID='8132']"> <xsl:sort select="../Field[ID='8131']/Value"/> <tr> <td><xsl:value-of select="../Field[ID='8132']/Value"/></td> <td><xsl:value-of select="../Field[ID='8131']/Value"/></td> </xsl:for-each> </tr> </tbody></table> '8132' is the Type field, '8131' is the Name field. Hope I've explained this clearly. Thanks in advance for any assistance!
×
×
  • Create New...