Showing:

Documentation
Overriding
Included from
Source
Stylesheet part2.xsl
Documentation

Description

TEI stylesheet for converting Word docx files to TEI

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Author: See AUTHORS

Id: $Id: docx-tei.xsl 6820 2009-10-10 20:03:31Z rahtz $

Copyright: 2008, TEI Consortium

Included from
Template @*|comment()|processing-instruction()part2
Namespace No namespace
Match @*|comment()|processing-instruction()
Mode part2
Import precedence 6
Source
<xsl:template match="@*|comment()|processing-instruction()" mode="part2">
  <xsl:copy-of select="."/>
</xsl:template>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template *part2
Namespace No namespace
Match *
Mode part2
Import precedence 6
Source
<xsl:template match="*" mode="part2">
  <xsl:copy>
    <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="part2"/>
  </xsl:copy>
</xsl:template>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template text()part2
Namespace No namespace
Match text()
Mode part2
Overriding
Template text()part2
Import precedence 6
Source
<xsl:template match="text()" mode="part2">
  <xsl:value-of select="."/>
</xsl:template>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:hi[not(*) and string-length(.)=0]part2
Documentation

Description

Zap empty hi, p and item

Namespace No namespace
Match tei:hi[not(*) and string-length(.)=0]
Mode part2
Import precedence 6
Source
<xsl:template match="tei:hi[not(*) and string-length(.)=0]" mode="part2"/>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:item[not(*) and string-length(.)=0]part2
Namespace No namespace
Match tei:item[not(*) and string-length(.)=0]
Mode part2
Import precedence 6
Source
<xsl:template match="tei:item[not(*) and string-length(.)=0]" mode="part2"/>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:p[not(*) and string-length(.)=0]part2
Namespace No namespace
Match tei:p[not(*) and string-length(.)=0]
Mode part2
Import precedence 6
Source
<xsl:template match="tei:p[not(*) and string-length(.)=0]" mode="part2"/>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:list/tei:listpart2
Documentation

Description

Inner lists in lists must be moved to inside items

Namespace No namespace
Match tei:list/tei:list
Mode part2
Overriding
Import precedence 6
Source
<xsl:template match="tei:list/tei:list" mode="part2"/>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:itempart2
Namespace No namespace
Match tei:item
Mode part2
Overriding
Template tei:itempart2
Import precedence 6
Source
<xsl:template match="tei:item" mode="part2">
  <item>
    <xsl:copy-of select="@*"/>
    <xsl:variable name="me" select="generate-id()"/>
    <xsl:apply-templates mode="part2"/>
    <!-- find following sibling lists and notes -->
    <xsl:for-each select="following-sibling::tei:list[preceding-sibling::tei:item[1][generate-id()=$me]]">
      <list>
        <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="part2"/>
      </list>
    </xsl:for-each>
  </item>
</xsl:template>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:head/tei:hi[.=' ']part2
Documentation

Description

Bold emdash in title, forget it

Namespace No namespace
Match tei:head/tei:hi[.=' ']
Mode part2
Import precedence 6
Source
<xsl:template match="tei:head/tei:hi[.=' ']" mode="part2"/>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:head/text()part2
Documentation

Description

Zap emdashes at start of head

Namespace No namespace
Match tei:head/text()
Mode part2
Import precedence 6
Source
<xsl:template match="tei:head/text()" mode="part2">
  <xsl:choose>
    <xsl:when test="starts-with(.,'— ')">
      <xsl:value-of select="substring(.,3)"/>
    </xsl:when>
    <xsl:when test="starts-with(.,' — ')">
      <xsl:value-of select="substring(.,4)"/>
    </xsl:when>
    <xsl:when test="starts-with(.,' — ')">
      <xsl:value-of select="substring(.,4)"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="."/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:seg[not(@*)]part2
Documentation

Description

A <seg> which does nothing is not worth having

Namespace No namespace
Match tei:seg[not(@*)]
Mode part2
Import precedence 6
Source
<xsl:template match="tei:seg[not(@*)]" mode="part2">
  <xsl:choose>
    <xsl:when test="parent::tei:formula and normalize-space(.)=''"/>
    <xsl:when test="parent::*/text()">
      <xsl:value-of select="."/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:copy-of select="."/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:textpart2
Documentation

Description

Look at the sections we have generated, and put them in <front> or <body> as appropriate

Namespace No namespace
Match tei:text
Mode part2
Overriding
Template tei:textpart2
Import precedence 6
Source
<xsl:template match="tei:text" mode="part2">
  <text>
    <xsl:for-each select="tei:fw">
      <xsl:copy-of select="."/>
    </xsl:for-each>
    <body>
      <xsl:for-each select="tei:body/tei:*">
        <xsl:apply-templates select="." mode="part2"/>
      </xsl:for-each>
    </body>
  </text>
</xsl:template>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:listBibl/tei:ppart2
Documentation

Description

A <p> inside a listBibl is moved out

Namespace No namespace
Match tei:listBibl/tei:p
Mode part2
Import precedence 6
Source
<xsl:template match="tei:listBibl/tei:p" mode="part2"/>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:listBiblpart2
Namespace No namespace
Match tei:listBibl
Mode part2
Import precedence 6
Source
<xsl:template match="tei:listBibl" mode="part2">
  <xsl:for-each select="tei:p">
    <p>
      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="part2"/>
    </p>
  </xsl:for-each>
  <listBibl>
    <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="part2"/>
  </listBibl>
</xsl:template>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:list[@type='gloss']/tei:item/tei:hi[tei:c[@rend='tab']]part2
Documentation

Description

A tab (in a hi)? in a gloss list

Namespace No namespace
Match tei:list[@type='gloss']/tei:item/tei:hi[tei:c[@rend='tab']]
Mode part2
Import precedence 6
Source
<xsl:template match="tei:list[@type='gloss']/tei:item/tei:hi[tei:c[@rend='tab']]" mode="part2"/>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:list[@type='gloss']/tei:item/tei:c[@rend='tab']part2
Namespace No namespace
Match tei:list[@type='gloss']/tei:item/tei:c[@rend='tab']
Mode part2
Import precedence 6
Source
<xsl:template match="tei:list[@type='gloss']/tei:item/tei:c[@rend='tab']" mode="part2"/>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:list[@type='gloss']/tei:label[.='where']part2
Documentation

Description

Top of a weird gloss list

Namespace No namespace
Match tei:list[@type='gloss']/tei:label[.='where']
Mode part2
Import precedence 6
Source
<xsl:template match="tei:list[@type='gloss']/tei:label[.='where']" mode="part2">
  <head>
    <xsl:apply-templates/>
  </head>
</xsl:template>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:bibl/tei:c[@rend='tab']part2
Documentation

Description

A tab in a <bibl>? no.

Namespace No namespace
Match tei:bibl/tei:c[@rend='tab']
Mode part2
Import precedence 6
Source
<xsl:template match="tei:bibl/tei:c[@rend='tab']" mode="part2"/>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:gloss//tei:c[@rend='tab']part2
Documentation

Description

A tab in a <gloss>? no.

Namespace No namespace
Match tei:gloss//tei:c[@rend='tab']
Mode part2
Import precedence 6
Source
<xsl:template match="tei:gloss//tei:c[@rend='tab']" mode="part2"/>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:hi[count(*)=1 and not(text()) and tei:lb]part2
Documentation

Description

A bold line break???


Description

 removed 2010-03-15, seems to screw up formulae
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
      <desc>
         <p>     A tab in a &lt;formula&gt;? no. </p>
      </desc>
    </doc>

    <xsl:template match="tei:formula//tei:c[@rend='tab']" mode="part2"/>
    
Namespace No namespace
Match tei:hi[count(*)=1 and not(text()) and tei:lb]
Mode part2
Import precedence 6
Source
<xsl:template match="tei:hi[count(*)=1 and not(text()) and tei:lb]" mode="part2">
  <tei:lb/>
</xsl:template>
Stylesheet location ../../../docx/from/part2/part2.xsl
Template tei:head/tei:c[@rend='tab']part2
Documentation

Description

A tab in a <head>? no.

Namespace No namespace
Match tei:head/tei:c[@rend='tab']
Mode part2
Import precedence 6
Source
<xsl:template match="tei:head/tei:c[@rend='tab']" mode="part2"/>
Stylesheet location ../../../docx/from/part2/part2.xsl