-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathor_transcript_solr.xslt
39 lines (39 loc) · 1.86 KB
/
or_transcript_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
32
33
34
35
36
37
38
39
<?xml version="1.0" encoding="UTF-8"?>
<!-- ORALHISTORIES TRANSCRIPT -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:dcterms="http://purl.org/dc/terms/">
<xsl:template match="foxml:datastream[@ID='TRANSCRIPT']/foxml:datastreamVersion[last()][not(@MIMETYPE='text/vtt')]" name="index_TRANSCRIPT">
<xsl:param name="content"/>
<xsl:param name="prefix">or_</xsl:param>
<xsl:param name="solespeaker" select="$content//solespeaker"></xsl:param>
<xsl:for-each select="$content//cue">
<field>
<xsl:attribute name="name">
<xsl:value-of select="concat($prefix, 'cue_id')"/>
</xsl:attribute>
<xsl:value-of select="position()"/>
</field>
<xsl:if test="$content//solespeaker">
<field>
<xsl:attribute name="name">
<xsl:value-of select="concat($prefix, 'speaker')"/>
</xsl:attribute>
<xsl:value-of select="$solespeaker"/>
</field>
</xsl:if>
<xsl:apply-templates mode='slurping_oh_transform'>
<xsl:with-param name="prefix" select="$prefix"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>
<xsl:template match="//cue/*" mode='slurping_oh_transform'>
<xsl:param name="prefix" />
<xsl:for-each select=".">
<field>
<xsl:attribute name="name">
<xsl:value-of select="concat($prefix, local-name())"/>
</xsl:attribute>
<xsl:value-of select="."/>
</field>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>