Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reverse Sort...

Status
Not open for further replies.

rjonesX

Technical User
Jun 18, 2001
56
US
I just need my xml file to be read backwards by an xsl file... When someone add a news story to the xml file, it is placed at the end of the file. I want that one to be displayed first, and the first in the XML file to be displayed last...


any ideas? im using a simple xsl:for-each select="news"

the entries are not dated...

russ
 
try something like
-------------------
<xsl:apply-templates select=&quot;something&quot;>
<xsl:sort select=&quot;parent_el/element_to_sort&quot; order=&quot;descending&quot; ... />
<xsl:for-each select=&quot;parent_el&quot;>
<xsl:value-of select=&quot;element_to_sort&quot; />
</xsl:for-each>
</xsl:apply-templates>
----------------------


the definition of xsl:sort is
----------------------
<xsl:sort
select = string-expression
lang = { nmtoken }
data-type = { &quot;text&quot; | &quot;number&quot; | qname-but-not-ncname }
order = { &quot;ascending&quot; | &quot;descending&quot; }
case-order = { &quot;upper-first&quot; | &quot;lower-first&quot; } />
------------------------- mike griffith
----------------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top