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 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by/')">
80 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-sa/')">
83 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nd/')">
86 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nc/')">
89 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nc-nd/')">
92 <!-- There is actually no such licence as this, but East London uses it anyway! -->
93 <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nd-sa/')">