This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Sorting by attribute


My XML looks something like this:

  <related>
    <para><link internal="part2" text="c"/></para>
    <para><link page="test 1" text="a"/></para>
    <para><link page="test 2" text="d"/></para>
    <para><link page="test 3" text="b"/></para>
  </related>

I want to apply the link template to each of these, sorting them based on
what's in the text attribute.  I tried the following but got an "unspecified
error when I tried to display with IE5:
  <xsl:template match="related">
    <xsl:for-each select="para">
    <xsl:sort select="link/@text"/>
      <div><xsl:apply-templates/></div>
    </xsl:for-each>
  </xsl:template>

Could someone kindly set me straight.  Thanks.  Eric


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]