Skip to content

Commit

Permalink
w:r → tei:ab if text()
Browse files Browse the repository at this point in the history
Cf. #29
  • Loading branch information
dariok committed Apr 15, 2019
1 parent 1033312 commit 8e01671
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions t0.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,33 @@
<xsl:template match="w:p">
<p>
<xsl:apply-templates select="w:pPr/w:pStyle" />
<xsl:apply-templates select="w:r" />
</p>
</xsl:template>
<xsl:template match="w:pStyle">
<xsl:attribute name="style" select="@w:val" />
</xsl:template>

<xsl:template match="w:r[not(w:fldChar)]">
<ab>
<xsl:apply-templates select="w:rPr" />
</ab>
</xsl:template>
<xsl:template match="w:rPr">
<xsl:attribute name="style">
<xsl:apply-templates select="*" />
</xsl:attribute>
</xsl:template>
<xsl:template match="w:rPr/*">
<xsl:value-of select="local-name()"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="(@w:val | @w:ascii)"/>
<xsl:if test="following-sibling::*">
<xsl:text>; </xsl:text>
</xsl:if>
</xsl:template>

<xsl:template match="w:r[w:fldChar]">
<T />
</xsl:template>
</xsl:stylesheet>

0 comments on commit 8e01671

Please sign in to comment.