Attachment 'digitalObjectBundleToIndexDocument.xslt'

Download

   1 <?xml version="1.0" encoding="UTF-8"?>
   2 <xsl:stylesheet xmlns:oai="http://www.openarchives.org/OAI/2.0/"
   3                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   4 		xmlns:Index="http://statsbiblioteket.dk/2004/Index"
   5 		xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
   6 		xmlns:xalan="http://xml.apache.org/xalan"
   7 		xmlns:util="http://xml.apache.org/xalan/java/dk.statsbiblioteket.doms.disseminator.Util"
   8                 xmlns:foxml="info:fedora/fedora-system:def/foxml#"
   9                 xmlns:d="http://fedora.statsbiblioteket.dk/datatypes/digitalObjectBundle/"
  10                 xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
  11                 xmlns:dc="http://purl.org/dc/elements/1.1/"
  12                 exclude-result-prefixes="util xs xalan xsl foxml d oai_dc dc oai"
  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 		<Index:document Index:defaultBoost="1" Index:defaultType="token" Index:defaultFreetext="true" Index:defaultSuggest="false"
  22 				Index:defaultGroup="false" Index:langAutogroup="true" Index:resolver="https://sedna.statsbiblioteket.dk:8280/urn/" >
  23 			<xsl:attribute name="Index:id">
  24 				<xsl:value-of select="d:digitalObjectBundle/foxml:digitalObject/@PID"/>
  25 			</xsl:attribute>
  26 			<xsl:for-each select="d:digitalObjectBundle">
  27                 <Index:fields>
  28                     <!-- TODO: Currently only the first of most fields is indexed -->
  29                     <Index:group Index:name="ti" Index:navn="ti" Index:suggest="true">
  30                         <Index:field Index:repeat="true" Index:name="main_titel" Index:navn="ht" Index:type="token" Index:boostFactor="10">
  31                             <xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:title"/>
  32                         </Index:field>
  33                     </Index:group>
  34 
  35                     <Index:group Index:name="au" Index:navn="fo" Index:suggest="false">
  36                         <Index:field Index:name="author_person" Index:repeat="true" Index:navn="pe" Index:type="token" Index:boostFactor="10">
  37                             <xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:creator" />
  38                         </Index:field>
  39                         <Index:field Index:repeat="true" Index:name="author_corporation" Index:navn="ko" Index:type="token" Index:boostFactor="10">
  40                             <xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:publisher" />
  41                         </Index:field>
  42                     </Index:group>
  43 
  44                     <Index:field Index:repeat="true" Index:name="lma_long" Index:navn="lma_lang" Index:type="keyword">
  45                         <xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:type" />
  46                     </Index:field>
  47 
  48                     <Index:group Index:name="numbers" Index:navn="nr">
  49                         <Index:field Index:repeat="true" Index:name="ww" Index:navn="ww" Index:type="token">
  50                              <xsl:value-of select="foxml:digitalObject/@FEDORA_URI"/>
  51                         </Index:field>
  52                    </Index:group>
  53 
  54                    <Index:field Index:repeat="true" Index:name="lang" Index:navn="sp" Index:type="token">
  55                         <xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:language" />
  56                    </Index:field>
  57 
  58                    <Index:group Index:name="su" Index:navn="em" Index:suggest="true">
  59                        <Index:field Index:repeat="false" Index:name="su_dk" Index:navn="ldb" Index:type="keyword" Index:boostFactor="10">
  60                             <xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:subject" />
  61                         </Index:field>
  62                     </Index:group>
  63 
  64                     <Index:field Index:repeat="true" Index:name="year" Index:navn="år" Index:type="token" Index:boostFactor="2">
  65                         <!-- TODO: cut rest of date -->
  66                          <xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:date" />
  67                     </Index:field>
  68                     <Index:field Index:repeat="true" Index:name="rt" Index:navn="rt" Index:type="token">
  69                         <xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:description" />
  70                     </Index:field>
  71                     <Index:field Index:repeat="true" Index:name="rt" Index:navn="rt" Index:type="token">
  72                         <xsl:value-of select="util:decodeBase64(foxml:digitalObject/foxml:datastream[@ID='CONTENT']/foxml:datastreamVersion/foxml:xmlContent/d:content)" />
  73                     </Index:field>
  74 
  75                     <Index:field Index:name="shortformat" Index:type="stored" Index:freetext="false">
  76                         <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
  77                         <shortrecord>
  78                             <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
  79                                 <!--TODO!!!-->
  80                                 <rdf:Description rdf:about="http://www.ilrt.bristol.ac.uk/people/cmdjb/">
  81                                     <dc:title><xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:title"/></dc:title>
  82                                     <dc:creator><xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:creator"/></dc:creator>
  83                                     <dc:date><xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:date"/></dc:date>
  84                                     <dc:type xml:lang="da"><xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:type"/></dc:type>
  85                                     <dc:type xml:lang="en"><xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:type"/></dc:type>
  86                                     <!--TODO: Must be PID in storage-->
  87                                     <dc:identifier><xsl:value-of select="foxml:digitalObject/@PID"/></dc:identifier>
  88                                 </rdf:Description>
  89                             </rdf:RDF>
  90                         </shortrecord>
  91                         <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
  92 		      </Index:field>
  93 
  94                     <Index:field Index:name="sort_year_desc" Index:navn="sort_år_desc" Index:type="keyword" Index:boostFactor="1">
  95                         <!-- TODO: cut rest of date -->
  96                          <xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:date" />
  97                     </Index:field>
  98 
  99                     <Index:field Index:name="sort_year_asc" Index:navn="sort_år_asc" Index:type="keyword" Index:boostFactor="1">
 100                         <!-- TODO: cut rest of date -->
 101                          <xsl:value-of select="foxml:digitalObject/foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:date" />
 102                     </Index:field>
 103 
 104                 </Index:fields>
 105 
 106 
 107 
 108 
 109 
 110 
 111             </xsl:for-each>
 112         </Index:document>
 113 
 114     </xsl:template>
 115 
 116 </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.
  • [get | view] (2008-06-26 13:21:50, 220.5 KB) [[attachment:digitalObjectBundle.xml]]
  • [get | view] (2008-06-26 13:21:56, 3.9 KB) [[attachment:digitalObjectBundleToHTML.xslt]]
  • [get | view] (2008-06-26 13:22:02, 7.9 KB) [[attachment:digitalObjectBundleToIndexDocument.xslt]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.