From 1c0fdc6e552bac8bf4ae2c69ea0f93cd77da9b6b Mon Sep 17 00:00:00 2001
From: David Maus <maus@hab.de>
Date: Wed, 11 Oct 2017 10:31:58 +0200
Subject: [PATCH] Vokabular als XML-Dokument publizieren

---
 config/routes.php                        |  5 ++--
 resources/daten/repertorium/register.xml | 25 +++++++++++++-----
 resources/mets.xml                       |  6 ++++-
 resources/xslt/repertorium/vokabular.xsl | 33 ++++++++++++++++++++++++
 4 files changed, 59 insertions(+), 10 deletions(-)
 create mode 100644 resources/xslt/repertorium/vokabular.xsl

diff --git a/config/routes.php b/config/routes.php
index 8426157e..3618668a 100644
--- a/config/routes.php
+++ b/config/routes.php
@@ -41,8 +41,9 @@ $app->get('/repertorium/eintrag/{metsId}', 'controller.dynamicpage:handle')
 $app->get('/repertorium/liste', 'controller.repertorium.list:handle')
     ->bind('repertorium.liste');
 
-$app->get('/repertorium/orte', 'controller.staticpage:handle')
-    ->bind('repertorium.orte');
+
+$app->get('/repertorium/vokabular', 'controller.staticpage:handle')
+    ->bind('repertorium.vokabular');
 
 $app->get('/bibliographie', 'controller.staticpage:handle')
     ->bind('bibliographie');
diff --git a/resources/daten/repertorium/register.xml b/resources/daten/repertorium/register.xml
index 2e83022f..920625fc 100644
--- a/resources/daten/repertorium/register.xml
+++ b/resources/daten/repertorium/register.xml
@@ -1,18 +1,29 @@
-<?xml-stylesheet type="text/xsl" href="xslt/default.xsl"?>
 <TEI xmlns="http://www.tei-c.org/ns/1.0">
     <teiHeader>
         <fileDesc>
             <titleStmt>
-                <title> Selbstzeugnisse der Frühen Neuzeit in der Herzog August Bibliothek </title>
+                <title>Selbstzeugnisse der Frühen Neuzeit in der Herzog August Bibliothek – Register</title>
+                <principal ref="https://doi.org/10.1515/editio-2016-0009">Inga Hanna Ralle</principal>
+                <funder ref="http://d-nb.info/gnd/5055588-1">Niedersächsisches Ministerium für Wissenschaft
+                    und Kultur</funder>
+                <respStmt>
+                    <name>Jacqueline Krone</name>
+                    <resp>Metadaten, Recherche und Korrektur</resp>
+                </respStmt>
+                <respStmt>
+                    <name ref="http://orcid.org/0000-0001-9292-5673">David Maus</name>
+                    <resp>Technische Konzeption und Begleitung</resp>
+                </respStmt>
             </titleStmt>
             <publicationStmt>
                 <publisher>
-                    <name ref="http://d-nb.info/gnd/8989-8">Herzog August Bibliothek
-                        Wolfenbüttel</name>
+                    <name ref="http://d-nb.info/gnd/8989-8">Herzog August Bibliothek Wolfenbüttel</name>
                 </publisher>
-                <pubPlace>
-                    <name>Wolfenbüttel, Germany</name>
-                </pubPlace>
+                <pubPlace>Wolfenbüttel</pubPlace>
+                <date when="2017">2017</date>
+                <availability>
+                    <licence target="https://creativecommons.org/publicdomain/zero/1.0/">CC0</licence>
+                </availability>
             </publicationStmt>
             <sourceDesc>
                 <p>born digital</p>
diff --git a/resources/mets.xml b/resources/mets.xml
index dc776de0..6f58b12e 100644
--- a/resources/mets.xml
+++ b/resources/mets.xml
@@ -190,7 +190,7 @@
           <fptr FILEID="repertorium.liste.xml.twig"/>
           <xi:include href="daten/repertorium/mets.xml" xpointer="divs"/>
         </div>
-        <div ID="repertorium.orte">
+        <div ID="repertorium.vokabular">
           <fptr FILEID="repertorium.register.xml"/>
         </div>
       </div>
@@ -378,6 +378,10 @@
       <interfaceDef LOCTYPE="URL" xlink:href="http://www.w3.org/TR/xslt"/>
       <mechanism LOCTYPE="URL" xlink:href="xslt/repertorium/eintrag.xsl"/>
     </behavior>
+    <behavior STRUCTID="repertorium.vokabular">
+      <interfaceDef LOCTYPE="URL" xlink:href="http://www.w3.org/TR/xslt"/>
+      <mechanism LOCTYPE="URL" xlink:href="xslt/repertorium/vokabular.xsl"/>
+    </behavior>
     <behavior STRUCTID="edition">
       <interfaceDef LOCTYPE="URL" xlink:href="http://www.w3.org/TR/xslt"/>
       <mechanism LOCTYPE="URL" xlink:href="xslt/default.xsl"/>
diff --git a/resources/xslt/repertorium/vokabular.xsl b/resources/xslt/repertorium/vokabular.xsl
new file mode 100644
index 00000000..5f48ca05
--- /dev/null
+++ b/resources/xslt/repertorium/vokabular.xsl
@@ -0,0 +1,33 @@
+<xsl:transform version="1.0"
+               xmlns:tei="http://www.tei-c.org/ns/1.0"
+               xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:output method="xml" encoding="utf-8" indent="yes" media-type="application/xml"/>
+
+  <xsl:template match="node() | @*">
+    <xsl:copy>
+      <xsl:apply-templates select="node() | @*"/>
+    </xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="tei:title[parent::tei:titleStmt]">
+    <xsl:copy>Vokabular</xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="tei:classDecl">
+    <xsl:element name="classDecl" namespace="http://www.tei-c.org/ns/1.0">
+      <xsl:element name="taxonomy" namespace="http://www.tei-c.org/ns/1.0">
+        <xsl:for-each select="tei:taxonomy/tei:category">
+          <xsl:sort select="tei:catDesc/tei:term"/>
+          <xsl:copy>
+            <xsl:copy-of select="@xml:id"/>
+            <xsl:copy-of select="tei:catDesc"/>
+          </xsl:copy>
+        </xsl:for-each>
+      </xsl:element>
+    </xsl:element>
+  </xsl:template>
+
+  <xsl:template match="tei:text"/>
+
+</xsl:transform>
-- 
GitLab