Skip to content

Commit

Permalink
Undo f:overw -> mod translation
Browse files Browse the repository at this point in the history
  • Loading branch information
thvitt committed Oct 8, 2018
1 parent 7a3542f commit 2b6070d
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 1 deletion.
40 changes: 40 additions & 0 deletions src/main/odd/faust-tei.xml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,46 @@
</attList>
</elementSpec>

<classSpec ident="model.linePart.overwritten" type="model"/>

<elementSpec ident="under" ns="http://www.faustedition.net/ns" mode="add">
<desc>Das unter der Überschreibung stehende.</desc>
<classes>
<memberOf key="model.linePart.overwritten"/>
</classes>
<content>
<macroRef key="macro.lineContent"/>
</content>
</elementSpec>

<elementSpec ident="over" ns="http://www.faustedition.net/ns" mode="add">
<desc>Das auf dem Überschriebenden stehende.</desc>
<classes>
<memberOf key="model.linePart.overwritten"/>
</classes>
<content>
<macroRef key="macro.lineContent"/>
</content>
</elementSpec>

<elementSpec ident="overw" ns="http://www.faustedition.net/ns" mode="add">
<desc>Umgebung zur Kodierung von Überschreibungen.</desc>
<classes>
<memberOf key="model.zonePart"/>
<memberOf key="model.linePart"/>
<memberOf key="model.pPart.transcriptional"/>
<memberOf key="model.linePart.overwritten"/>
<memberOf key="att.global"/>
</classes>
<content>
<sequence minOccurs="2" maxOccurs="unbounded">
<classRef key="model.linePart.overwritten"/>
</sequence>
</content>
</elementSpec>



<!-- Die folgenden Elemente werden auch im dokumentarischen Transkript benutzt: -->
<elementSpec ident="abbr" mode="change">
<classes mode="change">
Expand Down
38 changes: 37 additions & 1 deletion src/main/xproc/update-tei-sources.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
</mod>
</xsl:template>

<!--
<xsl:template match="f:overw">
<mod>
<xsl:attribute name="rend" select="('overwrite', @rend)" separator=" "/>
Expand All @@ -60,6 +61,40 @@
<xsl:apply-templates select="@* except @rend, node()"/>
</seg>
</xsl:template>
-->

<xsl:function name="f:attrib-without" as="attribute()?">
<xsl:param name="attrib" as="attribute()?"/>
<xsl:param name="without" as="xs:string"/>
<xsl:variable name="tokens" select="tokenize($attrib, '\s+')"/>
<xsl:variable name="clean-tokens" select="remove($tokens, index-of($tokens, $without))"/>
<xsl:choose>
<xsl:when test="empty($clean-tokens)"/>
<xsl:otherwise>
<xsl:attribute name="{name($attrib)}" select="string-join($clean-tokens, ' ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>

<!-- undo f:overw etc. -->
<xsl:template match="mod[tokenize(@rend, '\s+') = 'overwrite']">
<f:overw>
<xsl:sequence select="f:attrib-without(@rend, 'overwrite')"/>
<xsl:apply-templates select="@* except @rend, node()"/>
</f:overw>
</xsl:template>

<xsl:template match="mod/seg[tokenize(@rend, '\s+') = 'over']">
<f:over>
<xsl:apply-templates select="f:attrib-without(@rend, 'over'), @* except @rend, node()"/>
</f:over>
</xsl:template>

<xsl:template match="mod/seg[tokenize(@rend, '\s+') = 'under']">
<f:under>
<xsl:apply-templates select="f:attrib-without(@rend, 'under'), @* except @rend, node()"/>
</f:under>
</xsl:template>

<!-- physical structure -->
<xsl:template match="ge:document">
Expand Down Expand Up @@ -159,9 +194,10 @@
</metamark>
</xsl:template>

<xsl:template match="processing-instruction('oxygen')">
<xsl:template match="processing-instruction('oxygen')|processing-instruction('xml-model')[not(preceding::processing-instruction('xml-model'))]">
<xsl:processing-instruction name="xml-model">href="http://dev.digital-humanities.de/ci/view/Faust/job/faust-schema-tei-340/lastSuccessfulBuild/artifact/target/schema/faust-tei.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"</xsl:processing-instruction>
<xsl:processing-instruction name="xml-model">href="http://dev.digital-humanities.de/ci/view/Faust/job/faust-schema-tei-340/lastSuccessfulBuild/artifact/target/schema/faust-tei.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"</xsl:processing-instruction>
</xsl:template>
<xsl:template match="processing-instruction('xml-model')[preceding::processing-instruction('xml-model')]"/>

</xsl:stylesheet>

0 comments on commit 2b6070d

Please sign in to comment.