Skip to content

Instantly share code, notes, and snippets.

@peterstadler
Created September 21, 2019 13:38
Show Gist options
  • Save peterstadler/a33df4f7cb3f1234c8f15d73a080a192 to your computer and use it in GitHub Desktop.
Save peterstadler/a33df4f7cb3f1234c8f15d73a080a192 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
xpath-default-namespace="http://www.w3.org/1999/xhtml"
version="2.0">
<!--
XSL script for transforming TEI readme files to Zenodo descriptions
-->
<xsl:output encoding="UTF-8" method="html" omit-xml-declaration="yes"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="//body"/>
</xsl:template>
<xsl:template match="h1|h2">
<xsl:element name="b">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="body">
<xsl:element name="div">
<p>Find more information about the Text Encoding Initative at <a href="https://tei-c.org">https://tei-c.org</a></p>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="div">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="@href[.='/']">
<xsl:attribute name="href">https://tei-c.org</xsl:attribute>
</xsl:template>
<xsl:template match="@href[.='http://www.tei-c.org/About/contact.xml']">
<xsl:attribute name="href">https://tei-c.org/about/contact/</xsl:attribute>
</xsl:template>
<xsl:template match="comment()" priority="1"/>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment