Re: [xsl] Sort by page number

Subject: Re: [xsl] Sort by page number
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Wed, 21 Oct 2009 17:37:04 +0200
Jostein Austvik Jacobsen wrote:

Lets assume that these pagebreaks can occur at any place within the
article. In the stylesheet above I've tried to sort the articles like
this:

<xsl:sort select=".//@page[1]"/>

In my head this XPath expression reads "in the current article -> go
through all of the descendants -> select all of their attributes ->
pick out the page attributes -> pick the first one".

However, when run; nothing is sorted - as if the xsl:sort wasn't there
at all. I suspect that maybe it searches through the entire document
each time so that all articles are sorted as "page 1"? What am I doing
wrong here...

I think you want select="(.//@page)[1]" although I think select=".//@page" would suffice as well.


--


	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

Current Thread