forked from discoverygarden/islandora_transforms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FOXML_properties_to_solr.xslt
executable file
·31 lines (28 loc) · 1.08 KB
/
FOXML_properties_to_solr.xslt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?xml version="1.0" encoding="UTF-8"?>
<!-- FOXML properties -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foxml="info:fedora/fedora-system:def/foxml#"
exclude-result-prefixes="foxml">
<!-- Create "date" fields for the dates... -->
<xsl:template match="foxml:property[substring-after(@NAME, '#')='createdDate' or substring-after(@NAME, '#')='lastModifiedDate']">
<xsl:param name="prefix">fgs_</xsl:param>
<field>
<xsl:attribute name="name">
<xsl:value-of select="concat($prefix, substring-after(@NAME,'#'), '_dt')"/>
</xsl:attribute>
<xsl:value-of select="@VALUE"/>
</field>
</xsl:template>
<!-- Index the fedora properties -->
<xsl:template match="foxml:property">
<xsl:param name="prefix">fgs_</xsl:param>
<xsl:param name="suffix">_s</xsl:param>
<field>
<xsl:attribute name="name">
<xsl:value-of select="concat($prefix, substring-after(@NAME,'#'), $suffix)"/>
</xsl:attribute>
<xsl:value-of select="@VALUE"/>
</field>
</xsl:template>
</xsl:stylesheet>