Well, I managed to get something working last night but then I got too tired to try and figure out just what the differences were between your code and mine. However, I did note that one thing in particular seemed to make a difference. The top line of your XML file should read something like this:
Code:
<?xml-stylesheet type="text/xsl" href="sort.xsl"?>
The following is what I used for the stylesheet:
Code:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0"
encoding="utf-8"/>
<xsl:template match="markers/book/highlights">
<xsl:for-each select="highlight">
<xsl:sort select="start" data-type="number" order="ascending"/>
<xsl:value-of select="start"/><br />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
One thing that I find odd though is that it doesn't appear to sort those numbers in ascending order, which I found very odd. Perhaps someone could explain just how this type of sort works?
Bookmarks