Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://doi.org/10.5281/zenodo.3378949
14 April 2025, 15:23:58 UTC
  • Code
  • Branches (0)
  • Releases (3)
  • Visits
    • Branches
    • Releases
      • 3
      • 3
      • 2
      • 1
    • 4d331d8
    • /
    • WeGA-ODD-4.12.0
    • /
    • xsl
    • /
    • to-mei_all.xsl
    Raw File Download
    Permalinks

    To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
    Select below a type of object currently browsed in order to display its associated SWHID and permalink.

    • content
    • directory
    • snapshot
    • release
    origin badgecontent badge Iframe embedding
    swh:1:cnt:619f6ea5d8c98b7abfe6e73c759904f4d0c1df2b
    origin badgedirectory badge Iframe embedding
    swh:1:dir:0d07c3d440d2dbd75b48f77bde6a147218b9921c
    origin badgesnapshot badge
    swh:1:snp:9086c578942bc286f19f598e8c14cd758274daa6
    origin badgerelease badge
    swh:1:rel:ef0e3d3f5d0428d4938d670891e6d533248c93d1
    Citations

    This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
    Select below a type of object currently browsed in order to generate citations for them.

    • content
    • directory
    • snapshot
    • release
    Generate software citation in BibTex format (requires biblatex-software package)
    Generating citation ...
    Generate software citation in BibTex format (requires biblatex-software package)
    Generating citation ...
    Generate software citation in BibTex format (requires biblatex-software package)
    Generating citation ...
    Generate software citation in BibTex format (requires biblatex-software package)
    Generating citation ...
    to-mei_all.xsl
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:wega="https://weber-gesamtausgabe.de/"
        xpath-default-namespace="http://www.music-encoding.org/ns/mei"
        xmlns="http://www.music-encoding.org/ns/mei"
        exclude-result-prefixes="xs wega"
        version="2.0">
        
        <xsl:param name="current-mei-version" as="xs:string">5.0</xsl:param>
        
        <xsl:output media-type="application/tei+xml" encoding="UTF-8" indent="no" method="xml"/>
        <xsl:preserve-space elements="*"/>
        
        <xsl:variable name="duplicatesWrapper" as="element()">
            <mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.1">
                <meiHead>
                    <fileDesc>
                        <titleStmt xml:id="titleStmt">
                            <title>Duplikat</title>
                        </titleStmt>
                        <pubStmt>
                            <respStmt n="WeGA">
                                <persName role="edt">Veit, Joachim</persName>
                            </respStmt>
                            <address>
                                <addrLine>Hornsche Str. 39</addrLine>
                                <addrLine>32756</addrLine>
                                <addrLine>Detmold</addrLine>
                                <addrLine>Germany</addrLine>
                            </address>
                            <availability>
                                <useRestrict>This work is available under a Creative Commons Attribution 4.0 International (CC BY 4.0) license.</useRestrict>
                            </availability>
                        </pubStmt>
                    </fileDesc>
                </meiHead>
                <music/>
            </mei>
        </xsl:variable>
        
        <xsl:template match="node() | @*" mode="#all">
            <xsl:copy>
                <xsl:apply-templates select="node() | @*" mode="#current"/>
            </xsl:copy>
        </xsl:template>
        
        <xsl:template match="processing-instruction()" priority="1"/>
        
        <xsl:template match="document-node()">
            <xsl:call-template name="inject-schema-references">
                <xsl:with-param name="schema-URL">https://music-encoding.org/schema/<xsl:value-of select="$current-mei-version"/>/mei-all.rng</xsl:with-param>
            </xsl:call-template>
            <xsl:apply-templates/>
        </xsl:template>
        
        <xsl:template match="mei[ref]" priority="10">
            <xsl:apply-templates select="$duplicatesWrapper"/>
        </xsl:template>
        
        <xsl:template match="q[parent::title]">
            <xsl:element name="rend">
                <xsl:attribute name="rend">quotedbl</xsl:attribute>
                <xsl:apply-templates/>
            </xsl:element>
        </xsl:template>
        
        <xsl:template match="pubStmt">
            <xsl:copy>
                <xsl:text>&#10;            </xsl:text>
                <xsl:element name="identifier">
                    <xsl:attribute name="type">WeGA</xsl:attribute>
                    <xsl:attribute name="auth.uri">https://weber-gesamtausgabe.de/</xsl:attribute>
                    <xsl:value-of select="ancestor::mei/@xml:id"/>
                </xsl:element>
                <xsl:text>&#10;            </xsl:text>
                <xsl:element name="distributor">Carl-Maria-von-Weber-Gesamtausgabe</xsl:element>
                <xsl:apply-templates select="node() except identifier[@type='WeGA'] | @*"/>
            </xsl:copy>
        </xsl:template>
        
        <xsl:template match="@meiversion">
            <xsl:attribute name="meiversion" select="$current-mei-version"/>
        </xsl:template>
        
        <xsl:template match="altId[@subtype]">
            <xsl:copy>
                <xsl:apply-templates select="@* except @subtype except @type"/>
                <xsl:attribute name="type" select="@type, @subtype"/>
                <xsl:apply-templates/>
            </xsl:copy>
        </xsl:template>
        
        <xsl:template match="@codedval[matches(., 'A[A-F0-9]{6}')]" mode="#all">
            <xsl:attribute name="auth.uri">https://weber-gesamtausgabe.de/</xsl:attribute>
            <xsl:attribute name="codedval" select="."/>
        </xsl:template>
        
        <xsl:template match="settlement[parent::event] | country[parent::event] | region[parent::event]">
            <xsl:element name="geogName">
                <xsl:copy>
                    <xsl:apply-templates select="@* | node()"/>
                </xsl:copy>
            </xsl:element>
        </xsl:template>
        
        <xsl:template name="inject-schema-references">
            <xsl:param name="schema-URL" as="xs:string"/>
            <xsl:text>&#10;</xsl:text>
            <xsl:processing-instruction name="xml-model">href="<xsl:value-of select="$schema-URL"/>" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"</xsl:processing-instruction>
            <xsl:text>&#10;</xsl:text>
            <xsl:processing-instruction name="xml-model">href="<xsl:value-of select="$schema-URL"/>" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"</xsl:processing-instruction>
            <xsl:text>&#10;</xsl:text>
        </xsl:template>
        
    </xsl:stylesheet>

    back to top

    Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
    The source code of Software Heritage itself is available on our development forge.
    The source code files archived by Software Heritage are available under their own copyright and licenses.
    Terms of use: Archive access, API— Contact— JavaScript license information— Web API