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]

Re: sorting by date



> So where, and how, do i include your xsl:sort tag?

You don't:-)

In this version you are not using a for-each or an apply-templates to
construct a current node list which you then process, you are selecting
your items one at a time and moving around the soutce "by hand" with
select="RetrieveTransactionHistory2RSResponse/Items/Item[position()=$ThisRec
ord]/Date" />

so you never (as far as I can see)  ever select more than one node at a
time so you can't use xsl:sort.

Most likely the easiest thing to do is sort forst into a temporary
variable

<xsl:variable name="x">
<RetrieveTransactionHistory2RSResponse><Items>
<xsl:for-each
select="RetrieveTransactionHistory2RSResponse/Items/Item"/>
<xsl:sort ...
<xsl:copy-of seelct="."/>
</xsl:for-each>
</Items></RetrieveTransactionHistory2RSResponse>
</xsl:variable>

then apply the templates you have got already using 

<xsl:apply-templates
select="xx:node-set($x)/RetrieveTransactionHistory2RSResponse"/>

where xx:node-set() is your processors node-set extension function.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 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]