1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2 xmlns:m="http://www.loc.gov/MARC21/slim"
3 xmlns:z="http://indexdata.dk/zebra/xslt/1"
4 exclude-result-prefixes="m z"
6 <!-- $Id: index.xsl,v 1.7 2007-02-15 13:01:00 marc Exp $ -->
7 <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
10 <xsl:template match="text()"/>
13 <xsl:template match="/m:record">
14 <z:record z:id="{normalize-space(m:controlfield[@tag='001'])}"
15 z:rank="{normalize-space(m:rank)}"
17 <xsl:apply-templates/>
21 <xsl:template match="m:controlfield[@tag='001']">
22 <z:index name="control">
23 <xsl:value-of select="normalize-space(.)"/>
27 <xsl:template match="m:datafield[@tag='245']/m:subfield[@code='a']">
28 <!-- nested. does not have to be! -->
29 <z:index name="title">
30 <z:index name="title" type="p">
31 <xsl:value-of select="."/>
35 <!-- can do. But sort register only supports numeric attributes. -->
36 <z:index name="title" type="s">
37 <xsl:value-of select="."/>