-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoaiset-map-generator.xsl
25 lines (22 loc) · 1.33 KB
/
oaiset-map-generator.xsl
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
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.tei-c.org/ns/1.0" xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias">
<xsl:strip-space elements="*" />
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
<xsl:namespace-alias stylesheet-prefix="axsl" result-prefix="xsl" />
<xsl:template match="/">
<!-- Generates an xslt stylesheet from an xml data file -->
<axsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.tei-c.org/ns/1.0">
<axsl:strip-space elements="*" />
<axsl:output method="xml" indent="yes" />
<!-- Create an xslt "hashmap" (key value pair) with the data of the xml file-->
<axsl:template name="codeOai">
<axsl:param name="code" />
<axsl:variable name="var">
<xsl:for-each select="//SubjectStruct">
<xsl:value-of select="concat(';', ./set/setSpec, '=', ./hal/code)"></xsl:value-of>
</xsl:for-each>
</axsl:variable>
<axsl:value-of select="substring-before(substring-after($var, concat(';', concat('ddc:', $code), '=')), ';')" />
</axsl:template>
</axsl:stylesheet>
</xsl:template>
</xsl:stylesheet>