2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:pz="http://www.indexdata.com/pazpar2/1.0" >
5 <xsl:param name="medium" />
7 <xsl:template match="/">
8 <xsl:apply-templates></xsl:apply-templates>
11 <xsl:template match="response">
12 <xsl:apply-templates></xsl:apply-templates>
15 <xsl:template match="records">
16 <xsl:apply-templates></xsl:apply-templates>
19 <xsl:template match="doc">
21 <xsl:if test="string-length($medium) > 0">
22 <pz:metadata type="medium">
23 <xsl:value-of select="$medium"/>
26 <xsl:apply-templates></xsl:apply-templates>
30 <xsl:template match="float[@name]">
32 <xsl:attribute name="type">
33 <xsl:value-of select="@name"/>
35 <xsl:value-of select="."/>
39 <xsl:template match="str[@name]">
41 <xsl:attribute name="type">
42 <xsl:value-of select="@name"/>
44 <xsl:value-of select="."/>
48 <xsl:template match="date[@name]">
50 <xsl:attribute name="type">
51 <xsl:value-of select="@name"/>
53 <xsl:value-of select="."/>
57 <xsl:template match="arr">
58 <xsl:for-each select="str">
59 <xsl:call-template name="string"/>
63 <xsl:template name="string">
65 <xsl:when test="../@name = 'medium' and string-length($medium) > 0">
69 <xsl:attribute name="type">
70 <xsl:value-of select="../@name"/>
72 <xsl:value-of select="."/>
74 <xsl:if test="../@name='license_url'">
75 <pz:metadata type="license_name">
77 <!-- Creative Commons licenses -->
78 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by/')">
81 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-sa/')">
84 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nd/')">
87 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nc/')">
90 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nc-sa/')">
93 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nc-nd/')">
97 <!-- There is actually no such license as this, but East London uses it anyway! -->
98 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nd-sa/')">
102 <!-- Creative Commons' public-domain tools are not actually licences, may well be used -->
103 <xsl:when test=". = 'http://creativecommons.org/about/cc0'">
106 <xsl:when test=". = 'http://creativecommons.org/about/pdm2'">
107 CC PDL (public domain)
110 <!-- The RIOXX profile itself provides two ways of saying "all rights reserved" -->
111 <xsl:when test=". = 'http://www.rioxx.net/licenses/all-rights-reserved'">
114 <xsl:when test=". = 'http://www.rioxx.net/licenses/under-embargo-all-rights-reserved'">