Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 09:39 AM
thomas
Guest
 
Posts: n/a
Default Sort XML

Is there anyway to sort an xml file either using asp or xsl BEFORE the
results are output by an xsl file, the way it works at the moment produces
some undesired results.

I use the below code to output 20 results per page but it only sorts the
first 20 results in the file then it sorts the next 20 results on the next
page.

<xsl:for-each select="cat/links[position() &gt;= $startPos and position()
&lt;= $endPos]">
<xsl:sort select="artist"/>
<code to output table>
</xsl:for-each>

In theory I would like the code to work like this but I get an error

<xsl:sort select="artist"/>
<xsl:for-each select="cat/links[position() &gt;= $startPos and position()
&lt;= $endPos]">
<code to output table>
</xsl:for-each>

Any Ideas?


  #2  
Old July 20th, 2005, 09:39 AM
bernwardhanssen@web.de
Guest
 
Posts: n/a
Default Re: Sort XML

Hi thomas

try

<xsl:for-each select="cat/links">
<xsl:sort select="links"/>
<xsl:if test="position() &gt; 2 and position() &lt;= 5">
<xsl:value-of select="."/>
</xsl:if>
</xsl:for-each>

Bernward

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles