Skip to content

Commit

Permalink
Merge branch 'master' of github.com:CDRH/abbot
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Ramsay committed May 20, 2013
2 parents dd512ce + d94ea96 commit dc628e1
Show file tree
Hide file tree
Showing 4 changed files with 12,031 additions and 11,682 deletions.
70 changes: 38 additions & 32 deletions resources/config/abbot_config.xml
Expand Up @@ -6,7 +6,7 @@
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
xmlns:tei="http://www.tei-c.org/ns/1.0">

<sitemap date="2012-08-28">
<sitemap date="2013-04-10">

<transformations default="custom-transformation" loggingType="XPath">

Expand All @@ -16,6 +16,43 @@

<custom-transformations>

<transformation type="xslt" activate="yes">
<desc>process the root element</desc>
<xsl:template match="*[not(parent::*)]" priority="1">

<xsl:processing-instruction name="xml-model">
<xsl:text>href="</xsl:text>
<xsl:value-of select="$user-supplied-xml-model"/>
<xsl:text>"</xsl:text>
</xsl:processing-instruction>

<!-- retain for testing <xsl:processing-instruction name="user-supplied-namespace">
<xsl:text>href="</xsl:text>
<xsl:value-of select="$user-supplied-namespace"/>
<xsl:text>"</xsl:text>
</xsl:processing-instruction>-->

<xsl:element name="TEI" namespace="{$user-supplied-namespace}">
<xsl:for-each select="attribute::*">
<xsl:choose>
<xsl:when
test="name() = 'n'
or name() = 'id'
or name() = 'xml:id'">
<xsl:attribute name="xml:id">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:when>
<!--<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>-->
</xsl:choose>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</transformation>

<transformation type="xslt" activate="yes">
<desc>add 'div' around 'stage' where lacking</desc>
<xsl:template match="stage[preceding-sibling::*[1][name()='sp' or name()='stage']]"
Expand Down Expand Up @@ -2342,37 +2379,6 @@
</xsl:template>
</transformation>

<transformation type="xslt" activate="yes">
<desc>process the root element</desc>
<xsl:template match="*[not(parent::*)]" priority="1">

<xsl:processing-instruction name="xml-model">
<xsl:text>href="</xsl:text>
<xsl:value-of select="$user-supplied-xml-model"/>
<xsl:text>"</xsl:text>
</xsl:processing-instruction>

<xsl:element name="TEI" namespace="{$user-supplied-namespace}">
<xsl:for-each select="@*">
<xsl:choose>
<xsl:when
test="name() = 'n'
or name() = 'id'
or name() = 'xml:id'">
<xsl:attribute name="xml:id">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:when>
<!--<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>-->
</xsl:choose>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</transformation>

<transformation type="xslt" activate="yes">
<desc>suppress 'idg' element</desc>
<xsl:template match="*[lower-case(name())='idg']" priority="1"/>
Expand Down

0 comments on commit dc628e1

Please sign in to comment.