Attachment 'digitalObjectBundleToHTML.xslt'
Download 1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:oai="http://www.openarchives.org/OAI/2.0/"
4 xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
5 xmlns:xalan="http://xml.apache.org/xalan"
6 xmlns:util="http://xml.apache.org/xalan/java/dk.statsbiblioteket.doms.disseminator.Util"
7 xmlns:foxml="info:fedora/fedora-system:def/foxml#"
8 xmlns:d="http://fedora.statsbiblioteket.dk/datatypes/digitalObjectBundle/"
9 xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
10 xmlns:dc="http://purl.org/dc/elements/1.1/"
11 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
12 exclude-result-prefixes="util xs xalan xsl foxml d oai oai_dc dc rdf"
13 version="1.0">
14
15 <xsl:output version="1.0" encoding="UTF-8" indent="yes" method="xml"/>
16 <xsl:template match="/">
17 <xsl:apply-templates select="oai:record/oai:metadata"/>
18 </xsl:template>
19
20 <xsl:template match="oai:metadata">
21 <div class="longDomsResult">
22 <xsl:apply-templates select="d:digitalObjectBundle"/>
23 </div>
24 </xsl:template>
25
26 <xsl:template match="d:digitalObjectBundle">
27 <xsl:apply-templates select="foxml:digitalObject[position()=1]">
28 <xsl:with-param name="level" select="0"/>
29 </xsl:apply-templates>
30 </xsl:template>
31
32 <xsl:template match="foxml:digitalObject">
33 <xsl:param name="level"/>
34 <xsl:apply-templates select="foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc">
35 <xsl:with-param name="level" select="$level"/>
36 </xsl:apply-templates>
37 <!-- TODO: show datastreams? -->
38 <xsl:apply-templates select="foxml:datastream[@ID='RELS-EXT']/foxml:datastreamVersion/foxml:xmlContent/rdf:RDF">
39 <xsl:with-param name="level" select="$level"/>
40 </xsl:apply-templates>
41 </xsl:template>
42
43 <xsl:template match="oai_dc:dc">
44 <xsl:param name="level"/>
45 <table>
46 <xsl:for-each select="*">
47 <tr>
48 <td><xsl:value-of select="name()"/></td>
49 <td><xsl:value-of select="text()"/></td>
50 </tr>
51 </xsl:for-each>
52 </table>
53 </xsl:template>
54
55 <xsl:template match="rdf:RDF">
56 <xsl:param name="level"/>
57 <xsl:for-each select="rdf:Description/*">
58 <xsl:variable name="resource" select="substring(@rdf:resource, 13)"/>
59 <xsl:choose>
60 <xsl:when test="name()='sb:hasTIFFFile'">
61 <a href="http://localhost:7900/fedora/get/{$resource}/CONTENT">
62 <xsl:value-of select="../../../../../../foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:title"/> (image)
63 </a>
64 <!-- TODO fedora url! -->
65 </xsl:when>
66 <xsl:when test="name()='sb:hasUTF8File'">
67 <a href="http://localhost:7900/fedora/get/{$resource}/CONTENT">
68 <xsl:value-of select="../../../../../../foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:title"/> (text)
69 </a>
70 <!-- TODO fedora url! -->
71 </xsl:when>
72 <!-- TODO more links -->
73 <xsl:when test="//foxml:digitalObject[@PID=$resource]">
74 <div class="box">
75 <span class="relation"><xsl:value-of select="name()"/></span>
76 <xsl:apply-templates select="//foxml:digitalObject[@PID=$resource]">
77 <xsl:with-param name="level" select="$level + 1"/>
78 </xsl:apply-templates>
79 </div>
80 </xsl:when>
81 </xsl:choose>
82 </xsl:for-each>
83 </xsl:template>
84 </xsl:stylesheet>
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.