You sure can ... but with caveats. Look in the XSLT for:
<!-- for real results -->
<xsl:apply-templates select="RES/R">
<xsl:with-param name="query" select="$query"/>
</xsl:apply-templates>
Let's say you wanted to sort numerically in ascending order. This
would do the trick:
<!-- for real results -->
<xsl:apply-templates select="RES/R[MT/@N='nafn']">
<xsl:sort select="MT/@V" data-type="number" order="ascending" />
<xsl:with-param name="query" select="$query"/>
</xsl:apply-templates>
The square brackets act as a filter for metadata with a name of "nafn"
while the xsl:sort element lets us zone in on the value.
Now for the caveats:
First, be wary of R/@L (level). You may want to disable directory
crowding[1] in this case anyway (via filter=p).
Second, using my particular example, if any results do NOT have
metadata with a name of "nafn" they will go missing ... and knock your
total out of whack (e.g., "Results 1 - 10").
While you could mess around with the top_sep_bar template, it would be
a lot cleaner to always have a consistent 10 (or 20, 30, etc.) results
per page.
To work around this, I was about to suggest letting the GSA filter by
metadata[2] for you (via requiredfields), but now I'm not sure if that
takes wildcards.
Hmm. Only one way to find out! "Left as a well-meaning exercise for
the reader." ;)
--
Joe D'Andrea
Liquid Joe LLC
+1 (908) 781-0323
www.liquidjoe.biz
[1] http://snurl.com/70d8u [code_google_com]
[2] http://snurl.com/4u015 [code_google_com]
> ... i'm having problems with the language sort, doesnt seem to sort
> correctly even if i specify a lang parameter for the sort ...
>
> <xsl:apply-templates select="RES/R">
> <xsl:with-param name="query" select="$query"/>
> <xsl:sort select="MT[@N='nafn']/@V" lang="is"
> order="ascending"/>
> </xsl:apply-templates>
The GSA uses libxslt ... which I suspect doesn't support the lang
attribute, largely because support for it appears to have been added
to libxslt only this past June. :(
"Tue Jun 3 18:26:26 CEST: patch ... adding xsl:sort lang support using
the locale support from the C library."[1]
(Again, this is for libxslt in general.)
Meanwhile, you should be OK putting xsl:sort after xsl:with-param.
("When used within xsl:for-each, xsl:for-each-group, or
xsl:perform-sort, xsl:sort elements must occur before any other
children."[2])
Final reality check, "the effective value of the attribute must be a
value that would be valid for the xml:lang attribute."[3] In your case
it's Icelandic (is) which is indeed the ISO code.
That reminds me ... I really have to visit Reykjavik again!
--
Joe D'Andrea
Liquid Joe LLC
+1 (908) 781-0323
www.liquidjoe.biz
[1] http://www.xmlsoft.org/XSLT/ChangeLog.html
[2] http://www.w3.org/TR/xslt20/#sorting
[3] http://www.w3.org/TR/xml/#sec-lang-tag