Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Magnus Enger
committed
Aug 5, 2010
1 parent
8092de9
commit 9899e44
Showing
3 changed files
with
86 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:zs="http://www.loc.gov/zing/srw/"> | ||
<xsl:output | ||
method="xml" | ||
encoding="UTF-8"/> | ||
|
||
<xsl:param name="sortBy"/> | ||
<xsl:param name="sortOrder"/> | ||
|
||
<xsl:template match="/"> | ||
|
||
<xsl:element name="records"> | ||
|
||
<xsl:choose> | ||
<xsl:when test="$sortBy='author'"> | ||
<xsl:apply-templates select="//record"> | ||
<xsl:sort select="datafield[@tag=100]/subfield[@code='a']" data-type="text" order="{$sortOrder}"/> | ||
</xsl:apply-templates> | ||
</xsl:when> | ||
<xsl:when test="$sortBy='year'"> | ||
<xsl:apply-templates select="//record"> | ||
<xsl:sort select="translate(datafield[@tag=260]/subfield[@code='c'], 'cop.[]', '')" data-type="text" order="{$sortOrder}"/> | ||
</xsl:apply-templates> | ||
</xsl:when> | ||
<xsl:when test="$sortBy='title'"> | ||
<xsl:apply-templates select="//record"> | ||
<xsl:sort select="datafield[@tag=245]/subfield[@code='a']" data-type="text" order="{$sortOrder}"/> | ||
</xsl:apply-templates> | ||
</xsl:when> | ||
</xsl:choose> | ||
|
||
</xsl:element> | ||
|
||
</xsl:template> | ||
|
||
<xsl:template match="//record"> | ||
<xsl:copy-of select="."/> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |