Skip to content
Snippets Groups Projects
stammb_bibl2html_einzeldateien.xsl 8.94 KiB
<?xml version="1.0" encoding="UTF-8"?>

<!-- Dieses Stylesheet ist Teil von

Philipp Hainhofer: Das Große Stammbuch. Kommentierte digitale Edition eines bedeutenden Album Amicorum aus der Zeit um 1600 [Wolfenbütteler Digitale Editionen, Nr. 6], herausgegeben, transkribiert, übersetzt und kommentiert von Sabine Jagodzinski, Wolfenbüttel: Herzog August Bibliothek 2024, https://stammbuch.hab.de/stammbuch

und wurde erstellt von Martin de la Iglesia (iglesia@hab.de).

Es erzeugt für jeden Eintrag in der TEI/XML-Datei der Bibliographie jeweils eine XHTML-Datei. -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xhtml="http://www.w3.org/1999/xhtml" exclude-result-prefixes="#all" version="2.0" xpath-default-namespace="http://www.tei-c.org/ns/1.0">
    <xsl:output method="xhtml" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="yes"/>
    
    <xsl:variable name="psnpfad">../../register/personen/</xsl:variable>
    <xsl:variable name="outputpfad">bibliographie/</xsl:variable>  
    <xsl:variable name="stammbuchpfad">../stammbuch#</xsl:variable>
    
    <xsl:template match="/">
        <xsl:apply-templates select="//bibl"/>        
    </xsl:template>
    
    <xsl:template match="bibl">
        <xsl:result-document href="{$outputpfad}{@xml:id}.xhtml">
            <html xmlns="http://www.w3.org/1999/xhtml">
                <head>
                    <meta name="publisher" content="Herzog August Bibliothek Wolfenbüttel"/>
                    <link rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/de/"/>
                    <title><xsl:value-of select="seg"/></title>                    
                </head>
                <body>
                    <h1><xsl:value-of select="seg"/></h1>
                    <xsl:if test="ptr">
                        <div class="links">
                            <ul>                               
                                <xsl:for-each select="ptr[@type = 'fulltext']">
                                    <li class="fulltext">
                                        <a class="fulltextlink">
                                            <xsl:attribute name="href">
                                                <xsl:value-of select="./@target"/>
                                            </xsl:attribute>
                                            <xsl:text>Volltext</xsl:text>
                                        </a>
                                    </li>
                                </xsl:for-each>
                                <xsl:if test="ptr[@type = 'opac']">
                                    <li class="opac">
                                        <a class="opaclink">
                                            <xsl:attribute name="href">
                                                <xsl:value-of select="concat('http://opac.lbs-braunschweig.gbv.de/DB=2/XMLPRS=N/PPN?PPN=', ptr[@type = 'opac']/@cRef)"/>
                                            </xsl:attribute>
                                            <xsl:text>Katalogisat im OPAC der HAB</xsl:text>
                                        </a>
                                    </li>
                                </xsl:if>
                                <xsl:if test="ptr[@type = 'gbv']">
                                    <li class="gbv">
                                        <a class="gbvlink">
                                            <xsl:attribute name="href">
                                                <xsl:value-of select="concat('https://kxp.k10plus.de/DB=2.1/PPNSET?PPN=', ptr[@type = 'gbv']/@cRef)"/>
                                            </xsl:attribute>
                                            <xsl:text>Katalogisat im Gemeinsamen Verbundkatalog (GVK)</xsl:text>
                                        </a>
                                    </li>
                                </xsl:if>
                                <xsl:if test="ptr[@type = 'bvb']">
                                    <li class="bvb">
                                        <a class="bvblink">
                                            <xsl:attribute name="href">
                                                <xsl:value-of select="concat('https://gateway-bayern.de/', ptr[@type = 'bvb']/@cRef)"/>
                                            </xsl:attribute>
                                            <xsl:text>Katalogisat in Gateway Bayern</xsl:text>
                                        </a>
                                    </li>
                                </xsl:if>
                                <xsl:if test="ptr[@type = 'ph-reisen']">
                                    <li class="ph-reisen">
                                        <a class="ph-reisenlink">
                                            <xsl:attribute name="href">
                                                <xsl:value-of select="ptr[@type = 'ph-reisen']/@cRef"/>
                                            </xsl:attribute>
                                            <xsl:text>Eintrag in der Reiseberichte-Edition</xsl:text>
                                        </a>
                                    </li>
                                </xsl:if>
                            </ul>
                        </div>
                    </xsl:if>
                    <xsl:if test="linkGrp/link/@target">
                        <div class="occurrences">
                            <h2 class="occurrenceshead">Verwendet/erwähnt in</h2> 
                            <ul>
                                <xsl:for-each select="linkGrp/link">
                                    <xsl:choose>
                                        <xsl:when test="contains(@target,'&quot;view&quot;:&quot;info&quot;')">
                                            <li><a><xsl:attribute name="href" select="substring-before(@target,' ')"/>Handschriftenbeschreibung</a></li>
                                        </xsl:when>
                                        <xsl:when test="contains(@target,'einfuehrung')">
                                            <li><a><xsl:attribute name="href" select="substring-before(@target,' ')"/>Einführung</a></li>
                                        </xsl:when>
                                        <xsl:when test="starts-with(@target,'stammbuch:')">
                                            <xsl:variable name="seitenid" select="substring-before(substring-after(@target,'stammbuch:'),' ')"/>
                                            <li><a><xsl:attribute name="href" select="concat($stammbuchpfad,$seitenid)"/>Stammbuch, <xsl:choose>
                                                <xsl:when test="matches(document('stammbuch.xml')//div[@type='Eintrag'][@xml:id eq $seitenid]/div[@type='Seite']/p, '^[A-Z]')"/>
                                                <xsl:otherwise>S. </xsl:otherwise>
                                            </xsl:choose><xsl:value-of select="document('stammbuch.xml')//div[@type='Eintrag'][@xml:id eq $seitenid]/div[@type='Seite']/p"/></a></li>
                                        </xsl:when>
                                        <xsl:when test="starts-with(@target,'psn:')">
                                            <xsl:variable name="psnid" select="substring-before(substring-after(@target,'psn:'),' ')"/>
                                            <li><a><xsl:attribute name="href" select="concat($psnpfad,$psnid)"/>Personenregistereintrag zu <xsl:choose>
                                                <xsl:when test="document('stammb_psn.xml')//person[@xml:id eq $psnid]/persName[@type='preferred']/term/forename and document('stammb_psn.xml')//person[@xml:id eq $psnid]/persName[@type='preferred']/term/surname">
                                                    <xsl:value-of select="document('stammb_psn.xml')//person[@xml:id eq $psnid]/persName[@type='preferred']/term/forename"/><xsl:text> </xsl:text><xsl:value-of select="document('stammb_psn.xml')//person[@xml:id eq $psnid]/persName[@type='preferred']/term/surname"/>
                                                </xsl:when>
                                                <xsl:when test="document('stammb_psn.xml')//person[@xml:id eq $psnid]/persName[@type='preferred']/term/name">
                                                    <xsl:value-of select="document('stammb_psn.xml')//person[@xml:id eq $psnid]/persName[@type='preferred']/term/name"/>
                                                </xsl:when>
                                            </xsl:choose></a></li>
                                        </xsl:when>
                                    </xsl:choose>
                                </xsl:for-each>
                            </ul>
                        </div>
                    </xsl:if>
                </body>
            </html>
        </xsl:result-document>
    </xsl:template>
    
</xsl:stylesheet>