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]
Other format: [Raw text]

RE: <xsl:sort> question.


>
>    The version 1 will work and the version 2 will not sort
> the data, even
> though I think that these two are logically equivalent.
>   Please let me know what you think?  Thanks in advance!!
>
> **Version 2 - output the sorted last name**
>   <xsl:template match="/addressbook/address">
>     <xsl:for-each select=".">
>       <xsl:sort select="name/last-name"/>
>       <p>
>       <xsl:value-of select="name/last-name"/>
>       </p>
>     </xsl:for-each>
>   </xsl:template>
>
<xsl:for-each select="."> selects a single node and then sorts it, which
isn't a very useful thing to do.

Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com


 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]