Mode:

Compact lists

Showing:

Documentation
Parameters
Used by
References
Supersedes
Overriding
Imported modules
Included modules
Imported from
Source
Stylesheet teitodocx.xsl
Documentation

Description

TEI stylesheet for making Word docx files from TEI XML

This software is dual-licensed: 1. Distributed under a Creative Commons Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/ 2. http://www.opensource.org/licenses/BSD-2-Clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright holder or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

Author: See AUTHORS

Copyright: 2013, TEI Consortium

Imported modules
Included modules
Imported from
Stylesheet version 3.0
Template /
Documentation

Description

The starting points in the conversion to docx.

Description

Before main processing starts, pre-process the document elements in a separate mode ('pass0'), in order to add extra material which implements the footnoting etc. Also check that old files are there to be read.
Namespace No namespace
Match /
Mode #default
References
Variables
Parameters
Template
Import precedence 16
Source
<xsl:template match="/">
  <xsl:if test="not(doc-available($styleDoc))">
    <xsl:message terminate="yes">The file
      <xsl:value-of select="$styleDoc"/>cannot be read</xsl:message>
  </xsl:if>
  <xsl:if test="not(doc-available($coreFile))">
    <xsl:message terminate="yes">The file
      <xsl:value-of select="$coreFile"/>cannot be read</xsl:message>
  </xsl:if>
  <xsl:if test="not(doc-available($appFile))">
    <xsl:message terminate="yes">The file
      <xsl:value-of select="$appFile"/>cannot be read</xsl:message>
  </xsl:if>
  <xsl:if test="$debug='true'">
    <xsl:message>Processing file
      <xsl:value-of select="$inputFile"/>
    </xsl:message>
  </xsl:if>
  <xsl:variable name="pass0">
    <xsl:apply-templates mode="pass0"/>
  </xsl:variable>
  <!--
	  <xsl:result-document href="/tmp/x.xml">
	  <xsl:copy-of select="$pass0"/>
	  </xsl:result-document>
      -->
  <xsl:for-each select="$pass0/*">
    <xsl:call-template name="write-docxfiles"/>
  </xsl:for-each>
  <xsl:variable name="pass2">
    <xsl:apply-templates select="$pass0/*"/>
  </xsl:variable>
  <xsl:apply-templates select="$pass2/*" mode="pass2"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template /tei:TEI|/tei:teiCorpus
Namespace No namespace
Match /tei:TEI|/tei:teiCorpus
Mode #default
References
Import precedence 16
Source
<xsl:template match="/tei:TEI|/tei:teiCorpus">
  <xsl:call-template name="create-document-dot-xml"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template write-docxfiles
Documentation

Description

Calls templates that are responsible for creating all necessary files besides the main document.xml
Namespace No namespace
Used by
Template
References
Import precedence 16
Source
<xsl:template name="write-docxfiles">
  <!-- header and footers -->
  <xsl:call-template name="write-docxfile-header-files"/>
  <!-- footer files -->
  <xsl:call-template name="write-docxfile-footer-files"/>
  <!-- numbering file -->
  <xsl:call-template name="write-docxfile-numbering-definition"/>
  <!-- footnotes file -->
  <xsl:call-template name="write-docxfile-footnotes-file"/>
  <!-- endnotes file -->
  <xsl:call-template name="write-docxfile-endnotes-file"/>
  <!-- comments file -->
  <xsl:call-template name="write-docxfile-comments-file"/>
  <!-- main relationships -->
  <xsl:call-template name="write-docxfile-main-relationships"/>
  <!-- relationships -->
  <xsl:call-template name="write-docxfile-relationships"/>
  <!-- write Content Types -->
  <xsl:call-template name="write-docxfile-content-types"/>
  <!-- settings -->
  <xsl:call-template name="write-docxfile-settings"/>
  <!-- app files -->
  <xsl:call-template name="write-docxfile-docprops-core"/>
  <xsl:call-template name="write-docxfile-docprops-app"/>
  <xsl:call-template name="write-docxfile-docprops-custom"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template create-document-dot-xml
Documentation

Description

Create the contents of the main document.xml file, that contains all "real" content.
Namespace No namespace
Used by
References
Import precedence 16
Source
<xsl:template name="create-document-dot-xml">
  <w:document>
    <w:body>
      <!-- Front -->
      <xsl:call-template name="write-document-dot-xml-frontmatter"/>
      <!-- Main -->
      <xsl:call-template name="write-document-dot-xml-maincontent"/>
      <!-- Back -->
      <xsl:call-template name="write-document-dot-xml-backmatter"/>
      <!-- Clearing up at the end -->
      <xsl:call-template name="write-document-dot-xml-postclearing"/>
    </w:body>
  </w:document>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template write-document-dot-xml-frontmatter
Documentation

Description

Handles the front matter
Namespace No namespace
Used by
References
Template
Import precedence 16
Source
<xsl:template name="write-document-dot-xml-frontmatter">
  <!-- are there specific titlepages -->
  <xsl:call-template name="titlepages"/>
  <!-- The front matter -->
  <xsl:apply-templates select=".//tei:text/tei:front"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template write-document-dot-xml-maincontent
Documentation

Description

Handles the main content
Namespace No namespace
Used by
References
Import precedence 16
Source
<xsl:template name="write-document-dot-xml-maincontent">
  <!-- document title -->
  <xsl:call-template name="document-title"/>
  <!-- header components -->
  <xsl:call-template name="headerParts"/>
  <!-- Describes the main part of the document -->
  <xsl:apply-templates select=".//tei:text/tei:body"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template write-document-dot-xml-backmatter
Documentation

Description

Handles the back matter
Namespace No namespace
Used by
Import precedence 16
Source
<xsl:template name="write-document-dot-xml-backmatter">
  <!-- Describes the back matter of the document -->
  <xsl:apply-templates select=".//tei:text/tei:back"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template write-document-dot-xml-postclearing
Documentation

Description

Inserts final word specific sections

Inserts a final sectPr section if we need one

Namespace No namespace
Used by
References
Import precedence 16
Source
<xsl:template name="write-document-dot-xml-postclearing">
  <!-- write out final sectPr .. if exists -->
  <xsl:choose>
    <xsl:when test="tei:text/tei:milestone">
      <xsl:apply-templates select="tei:text/tei:milestone[1]">
        <xsl:with-param name="final-section">true</xsl:with-param>
      </xsl:apply-templates>
    </xsl:when>
    <xsl:otherwise>
      <xsl:apply-templates select="doc($defaultHeaderFooterFile)/tei:TEI/tei:text/tei:milestone">
        <xsl:with-param name="final-section">true</xsl:with-param>
      </xsl:apply-templates>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template block-element
Documentation

Description

Template used to process block elements:

  • style: A style for all the w:ps
  • pPr: An entire pPr element to use
  • nop: a w:p has already been created and no new w:p is to be created
  • bookmark-id: if present in conjunction with bookmark-name, a bookmark is created around the current element
  • bookmark-name: see bookmark-id
Namespace No namespace
Used by
References
Parameters
QName Namespace Select Type
bookmark-id No namespace
bookmark-name No namespace
nop No namespace
pPr No namespace node()*
select No namespace .
style No namespace
Import precedence 16
Source
<xsl:template name="block-element">
  <xsl:param name="style"/>
  <xsl:param name="select" select="."/>
  <xsl:param name="pPr" as="node()*"/>
  <xsl:param name="nop">false</xsl:param>
  <xsl:param name="bookmark-id"/>
  <xsl:param name="bookmark-name"/>
  <xsl:for-each select="$select">
    <xsl:for-each-group select="*|processing-instruction()|text()" group-adjacent="1">
      <xsl:call-template name="_process-blockelement">
        <xsl:with-param name="style" select="$style"/>
        <xsl:with-param name="pPr" select="$pPr"/>
        <xsl:with-param name="nop" select="$nop"/>
        <xsl:with-param name="bookmark-id" select="$bookmark-id"/>
        <xsl:with-param name="bookmark-name" select="$bookmark-name"/>
      </xsl:call-template>
    </xsl:for-each-group>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template _process-blockelement
Documentation

Description

This template processes block elements (or better to say the children of a block element) and should never be called directly (call block-element instead). The function processes all children and puts all inline elements into one w:p. If it encounters a nested block element (e.g. a note inside a p) then it closes the previous w:p processes that block element and then again starts putting all following inline elements into another w:p element. @see block-element


Description

 end template block-element 
Namespace No namespace
Used by
References
Parameters
QName Namespace Type
bookmark-id No namespace
bookmark-name No namespace
nop No namespace
pPr No namespace node()*
style No namespace
Import precedence 16
Source
<xsl:template name="_process-blockelement">
  <xsl:param name="style"/>
  <xsl:param name="pPr" as="node()*"/>
  <xsl:param name="nop"/>
  <xsl:param name="bookmark-id"/>
  <xsl:param name="bookmark-name"/>
  <!-- Process Child elements -->
  <xsl:for-each-group select="current-group()" group-starting-with="*[not(tei:isInline(.))]">
    <xsl:choose>
      <!-- if the current item is a block element, we process that one,
                     and then call this function recursively over all the other
                     elements -->
      <xsl:when test="self::*[not(tei:isInline(.))]">
        <!-- process block element -->
        <xsl:apply-templates select=".">
          <xsl:with-param name="style" select="$style"/>
          <xsl:with-param name="pPr" select="$pPr" as="node()*"/>
          <xsl:with-param name="nop" select="$nop"/>
        </xsl:apply-templates>
        <!-- process all the other elements in the current group -->
        <xsl:for-each-group select="current-group() except ." group-adjacent="1">
          <xsl:call-template name="_process-blockelement">
            <xsl:with-param name="style" select="$style"/>
            <xsl:with-param name="pPr" select="$pPr" as="node()*"/>
            <xsl:with-param name="nop" select="$nop"/>
          </xsl:call-template>
        </xsl:for-each-group>
      </xsl:when>
      <!-- we encountered an inline element. This means that the current group only
                     contains inline elements -->
      <xsl:otherwise>
        <!-- create all text runs for each item in the current group. we will later
                         on decide whether we are grouping them together in a w:p or not. -->
        <xsl:variable name="innerRuns">
          <!-- add paragraph properties (if nobody else created a w:p ($nop)) -->
          <xsl:if test="$nop!='true'">
            <xsl:choose>
              <xsl:when test="not($style='')">
                <w:pPr>
                  <w:pStyle>
                    <xsl:attribute name="w:val" select="$style"/>
                  </w:pStyle>
                </w:pPr>
                <xsl:copy-of select="$pPr[not(self::w:pPr)]"/>
              </xsl:when>
              <xsl:when test="not(empty($pPr))">
                <xsl:copy-of select="$pPr"/>
              </xsl:when>
            </xsl:choose>
          </xsl:if>
          <!-- bookmark start -->
          <xsl:if test="string-length($bookmark-name) > 0 and string-length($bookmark-id) > 0">
            <w:bookmarkStart w:id="{$bookmark-id}" w:name="{$bookmark-name}"/>
          </xsl:if>
          <!-- Create text runs -->
          <xsl:for-each select="current-group()">
            <xsl:apply-templates select=".">
              <xsl:with-param name="style" select="$style"/>
              <xsl:with-param name="pPr" select="$pPr" as="node()*"/>
            </xsl:apply-templates>
          </xsl:for-each>
          <!-- bookmark end-->
          <xsl:if test="string-length($bookmark-name) > 0 and string-length($bookmark-id) > 0">
            <w:bookmarkEnd w:id="{$bookmark-id}"/>
          </xsl:if>
        </xsl:variable>
        <!-- write out text runs.
                         if someone has already created a w:p ($nop) we may not create another one. -->
        <xsl:choose>
          <xsl:when test="$nop='true'">
            <xsl:copy-of select="$innerRuns"/>
          </xsl:when>
          <xsl:otherwise>
            <w:p>
              <xsl:copy-of select="$innerRuns"/>
            </w:p>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:for-each-group>
  <!-- end process children -->
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:anchor
Documentation

Description

Anchors

Description

 end template _process-blockelement 
Namespace No namespace
Match tei:anchor
Mode #default
Import precedence 16
Source
<xsl:template match="tei:anchor">
  <xsl:variable name="N">
    <xsl:number level="any"/>
  </xsl:variable>
  <w:bookmarkStart w:id="{number($N) + 20000}" w:name="{@xml:id}"/>
  <w:bookmarkEnd w:id="{number($N) + 20000}"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template text()
Documentation

Description

Handles text sections. Adds a bookmark if they are the first text in this object.
Namespace No namespace
Match text()
Mode #default
References
Templates
Parameter
Supersedes
Template
Parameters
QName Namespace
character-style No namespace
Import precedence 16
Source
<xsl:template match="text()">
  <xsl:param name="character-style"/>
  <xsl:choose>
    <xsl:when test="ancestor::tei:head"/>
    <xsl:when test="ancestor::tei:bibl"/>
    <xsl:when test="ancestor::tei:fw"/>
    <xsl:when test="preceding-sibling::text()"/>
    <xsl:when test="parent::tei:head/parent::tei:*/@xml:id">
      <xsl:for-each select="parent::tei:head/parent::tei:*">
        <xsl:variable name="N">
          <xsl:number level="any"/>
        </xsl:variable>
        <w:bookmarkStart w:id="{number($N) + 10000}" w:name="{@xml:id}"/>
      </xsl:for-each>
    </xsl:when>
    <xsl:when test="../@xml:id">
      <xsl:for-each select="..">
        <xsl:variable name="N">
          <xsl:number level="any"/>
        </xsl:variable>
        <w:bookmarkStart w:id="{number($N) + 10000}" w:name="{@xml:id}"/>
      </xsl:for-each>
    </xsl:when>
  </xsl:choose>
  <xsl:if test="parent::tei:head/parent::tei:div[@iso:status]">
    <w:r>
      <w:t>
        <xsl:attribute name="xml:space">preserve</xsl:attribute>
        <xsl:text> (</xsl:text>
        <xsl:value-of select="../../@iso:status"/>
        <xsl:text>) </xsl:text>
      </w:t>
    </w:r>
  </xsl:if>
  <!-- if no specific style is assigned we might check for any other indication to assign 
	   some style ... -->
  <xsl:variable name="renderingProperties">
    <xsl:for-each select="..">
      <xsl:call-template name="applyRend"/>
    </xsl:for-each>
    <xsl:if test="ancestor::tei:item/parent::tei:list/parent::tei:cell and not (parent::tei:cell)">
      <w:sz w:val="18"/>
    </xsl:if>
  </xsl:variable>
  <xsl:variable name="rProps">
    <xsl:if test="string-length($character-style) > 0 or not(empty($renderingProperties))">
      <w:rPr>
        <xsl:if test="string-length($character-style) > 0">
          <w:rStyle>
            <xsl:choose>
              <!-- this is a rogue - trap it and kill it -->
              <xsl:when test="$character-style='footnote reference'">
                <xsl:attribute name="w:val" select="'FootnoteReference'"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="w:val" select="$character-style"/>
              </xsl:otherwise>
            </xsl:choose>
          </w:rStyle>
        </xsl:if>
        <xsl:copy-of select="$renderingProperties"/>
        <xsl:if test="ancestor::*[@xml:lang]">
          <w:lang w:val="{ancestor::*[@xml:lang][1]/@xml:lang}"/>
        </xsl:if>
      </w:rPr>
    </xsl:if>
  </xsl:variable>
  <xsl:choose>
    <xsl:when test="$renderAddDel='true'">
      <w:r>
        <xsl:copy-of select="$rProps"/>
        <w:t>
          <xsl:call-template name="Text"/>
        </w:t>
      </w:r>
    </xsl:when>
    <xsl:when test="parent::tei:del">
      <w:del>
        <xsl:variable name="N">
          <xsl:for-each select="..">
            <xsl:number level="any"/>
          </xsl:for-each>
        </xsl:variable>
        <xsl:attribute name="w:id" select="number($N) + 50000"/>
        <xsl:if test="../@when">
          <xsl:attribute name="w:date">
            <xsl:value-of select="../@when"/>
          </xsl:attribute>
        </xsl:if>
        <w:r>
          <xsl:copy-of select="$rProps"/>
          <w:delText>
            <xsl:call-template name="Text"/>
          </w:delText>
        </w:r>
      </w:del>
    </xsl:when>
    <xsl:when test="parent::tei:add">
      <w:ins>
        <xsl:variable name="N">
          <xsl:for-each select="..">
            <xsl:number level="any"/>
          </xsl:for-each>
        </xsl:variable>
        <xsl:attribute name="w:id" select="number($N) + 50000"/>
        <xsl:if test="../@when">
          <xsl:attribute name="w:date">
            <xsl:value-of select="../@when"/>
          </xsl:attribute>
        </xsl:if>
        <w:r>
          <xsl:copy-of select="$rProps"/>
          <w:t>
            <xsl:call-template name="Text"/>
          </w:t>
        </w:r>
      </w:ins>
    </xsl:when>
    <xsl:otherwise>
      <w:r>
        <xsl:copy-of select="$rProps"/>
        <w:t>
          <xsl:call-template name="Text"/>
        </w:t>
      </w:r>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:choose>
    <xsl:when test="ancestor::tei:head"/>
    <xsl:when test="ancestor::tei:bibl"/>
    <xsl:when test="ancestor::tei:fw"/>
    <xsl:when test="following-sibling::text()"/>
    <xsl:when test="../@xml:id">
      <xsl:for-each select="..">
        <xsl:variable name="N">
          <xsl:number level="any"/>
        </xsl:variable>
        <w:bookmarkEnd w:id="{number($N) + 10000}"/>
      </xsl:for-each>
    </xsl:when>
    <xsl:when test="parent::tei:head/parent::tei:*/@xml:id">
      <xsl:for-each select="parent::tei:head/parent::tei:*">
        <xsl:variable name="N">
          <xsl:number level="any"/>
        </xsl:variable>
        <w:bookmarkEnd w:id="{number($N) + 10000}"/>
      </xsl:for-each>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template Text
Namespace No namespace
Used by
Template
Import precedence 16
Source
<xsl:template name="Text">
  <xsl:choose>
    <xsl:when test="parent::w:body">
      <xsl:message terminate="yes">CDATA found in body! [
        <xsl:value-of select="."/>]</xsl:message>
    </xsl:when>
    <xsl:otherwise>
      <xsl:variable name="out">
        <xsl:choose>
          <xsl:when test=".=' ' or ../@xml:space='preserve'">
            <xsl:value-of select="."/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:if test="starts-with(.,' ') or starts-with(.,'
')">
              <xsl:text> </xsl:text>
            </xsl:if>
            <xsl:value-of select="normalize-space(.)"/>
            <xsl:choose>
              <xsl:when test="substring(.,string-length(.),1)=' '">
                <xsl:text> </xsl:text>
              </xsl:when>
              <xsl:when test="substring(.,string-length(.),1)='	'">
                <xsl:text> </xsl:text>
              </xsl:when>
              <xsl:when test="substring(.,string-length(.),1)='
'">
                <xsl:text> </xsl:text>
              </xsl:when>
            </xsl:choose>
            <xsl:if test="substring(.,string-length(.),1)='
'">
              <xsl:text> </xsl:text>
            </xsl:if>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="contains($out,'ߛ')">
          <xsl:attribute name="xml:space">preserve</xsl:attribute>
          <xsl:value-of select="substring-before($out,'ߛ')"/>
          <w:noBreakHyphen/>
          <xsl:attribute name="xml:space">preserve</xsl:attribute>
          <xsl:value-of select="substring-after($out,'ߛ')"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:attribute name="xml:space">preserve</xsl:attribute>
          <xsl:value-of select="$out"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template *get-style
Documentation

Description

Style definition templates: No default Style for any block or inline element
Namespace No namespace
Match *
Mode get-style
Import precedence 16
Source
<xsl:template match="*" mode="get-style"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template getStyleName
Documentation

Description

to a given style name, this template returns the correct style id looking it up in styles.xml
Namespace No namespace
Used by
References
Variable
Key
Parameters
QName Namespace
in No namespace
Import precedence 16
Source
<xsl:template name="getStyleName">
  <xsl:param name="in"/>
  <xsl:for-each select="document($styleDoc,/)">
    <xsl:for-each select="key('Styles',$in)">
      <xsl:value-of select="parent::w:style/@w:styleId"/>
    </xsl:for-each>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:abbrget-style
Documentation

Description

Tests whether to add rendering elements to a run. Word styles cannot not be added in applyRend. If you want to add a style go for a get-style template. The order of these elements in Word does matter, by the way.
Namespace No namespace
Match tei:abbr
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:abbr" mode="get-style">teiabbr</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:biblget-style
Namespace No namespace
Match tei:bibl
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:bibl" mode="get-style">teibibl</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:citget-style
Namespace No namespace
Match tei:cit
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:cit" mode="get-style">teiquote</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:dateget-style
Namespace No namespace
Match tei:date
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:date" mode="get-style">date</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:foreignget-style
Namespace No namespace
Match tei:foreign
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:foreign" mode="get-style">foreign</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:formulaget-style
Namespace No namespace
Match tei:formula
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:formula" mode="get-style">Formula</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:orgNameget-style
Namespace No namespace
Match tei:orgName
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:orgName" mode="get-style">teiorgName</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:persNameget-style
Namespace No namespace
Match tei:persName
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:persName" mode="get-style">teipersName</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:placeNameget-style
Namespace No namespace
Match tei:placeName
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:placeName" mode="get-style">teiplaceName</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:qget-style
Namespace No namespace
Match tei:q
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:q" mode="get-style">teiq</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:quoteget-style
Namespace No namespace
Match tei:quote
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:quote" mode="get-style">teiquote</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:ref[@rend and not(@target)]get-style
Namespace No namespace
Match tei:ref[@rend and not(@target)]
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:ref[@rend and not(@target)]" mode="get-style">
  <xsl:value-of select="@rend"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:seg[@rend]get-style
Namespace No namespace
Match tei:seg[@rend]
Mode get-style
Import precedence 16
Source
<xsl:template match="tei:seg[@rend]" mode="get-style">
  <xsl:value-of select="@rend"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:p[@rend]get-style
Namespace No namespace
Match tei:p[@rend]
Mode get-style
References
Template
Import precedence 16
Source
<xsl:template match="tei:p[@rend]" mode="get-style">
  <xsl:call-template name="getStyleName">
    <xsl:with-param name="in" select="@rend"/>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template applyRend
Namespace No namespace
Used by
Templates
References
Import precedence 16
Source
<xsl:template name="applyRend">
  <!-- use a custom font -->
  <xsl:choose>
    <xsl:when test="@iso:font">
      <w:rFonts w:ascii="{@iso:font}" w:hAnsi="{@iso:font}"/>
    </xsl:when>
    <!-- typewriter font -->
    <xsl:when test="tei:render-typewriter(.)">
      <w:rFonts w:ascii="Courier" w:hAnsi="Courier"/>
    </xsl:when>
    <xsl:when test="tei:match(@rend, 'Special') or matches(@iso:style,'font-family')">
      <xsl:call-template name="getStyleFonts">
        <xsl:with-param name="css" select="@iso:style"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="matches(parent::*/@iso:style,'font-family')">
      <xsl:call-template name="getStyleFonts">
        <xsl:with-param name="css" select="parent::*/@iso:style"/>
      </xsl:call-template>
    </xsl:when>
  </xsl:choose>
  <!-- bold -->
  <xsl:choose>
    <xsl:when test="tei:render-bold(.)">
      <w:b/>
    </xsl:when>
    <xsl:when test="self::tbx:hi[@style='bold']">
      <w:i/>
    </xsl:when>
    <xsl:when test="tei:match(@rend,'normalweight')">
      <w:b w:val="0"/>
    </xsl:when>
  </xsl:choose>
  <!-- italic -->
  <xsl:choose>
    <xsl:when test="tei:render-italic(.)">
      <w:i/>
    </xsl:when>
    <xsl:when test="self::tei:emph">
      <w:i/>
    </xsl:when>
    <xsl:when test="self::tbx:hi[@style='italics']">
      <w:i/>
    </xsl:when>
    <xsl:when test="self::tbx:hi[@style='it']">
      <w:i/>
    </xsl:when>
  </xsl:choose>
  <!-- small caps -->
  <xsl:if test="tei:render-smallcaps(.)">
    <w:smallCaps/>
  </xsl:if>
  <!-- all caps -->
  <xsl:if test="tei:match(@rend,'allcaps')">
    <w:caps/>
  </xsl:if>
  <!-- strikethrough -->
  <xsl:choose>
    <xsl:when test="$renderAddDel='true' and ancestor-or-self::tei:del">
      <w:strike/>
    </xsl:when>
    <xsl:when test="tei:match(@rend,'strikethrough')">
      <w:strike/>
    </xsl:when>
    <xsl:when test="tei:match(@rend,'doublestrikethrough')">
      <w:dstrike/>
    </xsl:when>
  </xsl:choose>
  <!-- colour -->
  <xsl:variable name="color" select="tei:render-color(.)"/>
  <xsl:choose>
    <xsl:when test="$renderAddDel='true' and ancestor-or-self::tei:add">
      <w:color w:val="{$addColour}"/>
    </xsl:when>
    <xsl:when test="$color">
      <w:color w:val="{$color}"/>
    </xsl:when>
  </xsl:choose>
  <!-- background color -->
  <xsl:variable name="backgroundcolor" select="tei:render-backgroundcolor(.)"/>
  <xsl:if test="$backgroundcolor">
    <w:highlight w:val="{$backgroundcolor}"/>
  </xsl:if>
  <!-- underline -->
  <xsl:choose>
    <xsl:when test="tei:match(@rend,'underline') ">
      <w:u w:val="single"/>
    </xsl:when>
    <xsl:when test="tei:match(@rend,'wavyunderline') ">
      <w:u w:val="wave"/>
    </xsl:when>
    <xsl:when test="tei:match(@rend,'doubleunderline')">
      <w:u w:val="double"/>
    </xsl:when>
  </xsl:choose>
  <!-- sub- and superscript -->
  <xsl:choose>
    <xsl:when test="contains(@iso:style,'position')">
      <w:position>
        <xsl:attribute name="w:val">
          <xsl:value-of select="normalize-space(substring-before((substring-after(@iso:style,'position:')),';'))"/>
        </xsl:attribute>
      </w:position>
    </xsl:when>
    <xsl:when test="self::tbx:hi[@style='subscript']">
      <w:vertAlign w:val="subscript"/>
    </xsl:when>
    <xsl:when test="tei:match(@rend,'subscript')">
      <w:vertAlign w:val="subscript"/>
    </xsl:when>
    <xsl:when test="tei:match(@rend,'sub')">
      <w:vertAlign w:val="subscript"/>
    </xsl:when>
  </xsl:choose>
  <xsl:choose>
    <xsl:when test="self::tbx:hi[@style='superscript']">
      <w:vertAlign w:val="superscript"/>
    </xsl:when>
    <xsl:when test="tei:match(@rend,'superscript')">
      <w:vertAlign w:val="superscript"/>
    </xsl:when>
    <xsl:when test="tei:match(@rend,'sup')">
      <w:vertAlign w:val="superscript"/>
    </xsl:when>
  </xsl:choose>
  <!-- text direction -->
  <xsl:if test="@its:dir!=''">
    <!-- only handling RTL at the moment -->
    <xsl:if test="matches(@its:dir,'rtl')">
      <w:rtl/>
    </xsl:if>
  </xsl:if>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template plainNote
Documentation

Description

 
        plain note
    
Namespace No namespace
Used by
References
Supersedes
Template
Import precedence 16
Source
<xsl:template name="plainNote">
  <xsl:variable name="note">
    <w:r>
      <w:t>
        <xsl:attribute name="xml:space">preserve</xsl:attribute>
        <xsl:text> [</xsl:text>
        <xsl:choose>
          <xsl:when test="@n">
            <xsl:value-of select="@n"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:sequence select="tei:i18n('Note')"/>
            <xsl:text>: </xsl:text>
          </xsl:otherwise>
        </xsl:choose>
      </w:t>
    </w:r>
    <xsl:apply-templates/>
    <w:r>
      <w:t>
        <xsl:attribute name="xml:space">preserve</xsl:attribute>
        <xsl:text>] </xsl:text>
      </w:t>
    </w:r>
  </xsl:variable>
  <xsl:choose>
    <xsl:when test="tei:isInline(.)">
      <xsl:copy-of select="$note"/>
    </xsl:when>
    <xsl:otherwise>
      <w:p>
        <xsl:copy-of select="$note"/>
      </w:p>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template footNote
Namespace No namespace
Used by
Template
Supersedes
Template
Import precedence 16
Source
<xsl:template name="footNote">
  <xsl:variable name="num">
    <xsl:number count="tei:note[@place='foot' or @place='bottom']" level="any"/>
  </xsl:variable>
  <xsl:variable name="id" select="number($num)+1"/>
  <w:r>
    <w:rPr>
      <w:rStyle w:val="FootnoteReference"/>
    </w:rPr>
    <w:footnoteReference w:id="{$id}"/>
  </w:r>
  <!--
	<xsl:if test="not(matches(following-sibling::node()[1], '\p{Punct}))'
	<w:r>
	<w:t xml:space="preserve"> </w:t>
	</w:r>
	</xsl:if>
    -->
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template commentNote
Namespace No namespace
Used by
Template
Supersedes
Template
Import precedence 16
Source
<xsl:template name="commentNote">
  <w:r>
    <w:rPr>
      <w:rStyle w:val="CommentReference"/>
      <w:vanish/>
    </w:rPr>
    <xsl:variable name="n">
      <xsl:number level="any" count="tei:note[@place='comment']"/>
    </xsl:variable>
    <w:commentReference w:id="{$n - 1}"/>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template endNote
Documentation

Description

 
        Endnotes
    
Namespace No namespace
Used by
Template
Supersedes
Template
Import precedence 16
Source
<xsl:template name="endNote">
  <xsl:variable name="num">
    <xsl:number count="tei:note[@place='end']" level="any"/>
  </xsl:variable>
  <xsl:variable name="id" select="$num+1"/>
  <w:r>
    <w:rPr>
      <w:rStyle w:val="EndnoteReference"/>
    </w:rPr>
    <w:endnoteReference w:id="{$id}"/>
  </w:r>
  <w:r>
    <w:t xml:space="preserve"> </w:t>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:head[parent::tei:div or parent::tei:div1 or parent::tei:div2 or parent::tei:div3 or parent::tei:div4 or parent::tei:div5 or parent::tei:div6 or parent::tei:div7]
Documentation

Description

        Headers and Sections  
    
Namespace No namespace
Match tei:head[parent::tei:div or parent::tei:div1 or parent::tei:div2 or parent::tei:div3 or parent::tei:div4 or parent::tei:div5 or parent::tei:div6 or parent::tei:div7]
Mode #default
References
Parameters
QName Namespace Type
pPr No namespace node()*
Import precedence 16
Source
<xsl:template match="tei:head[parent::tei:div or parent::tei:div1 or parent::tei:div2 or parent::tei:div3 or parent::tei:div4 or parent::tei:div5 or parent::tei:div6 or parent::tei:div7]">
  <xsl:param name="pPr" as="node()*"/>
  <!-- find out what level we are at -->
  <xsl:variable name="level">
    <xsl:value-of select="count(ancestor-or-self::tei:div| ancestor-or-self::tei:div1| ancestor-or-self::tei:div2| ancestor-or-self::tei:div3| ancestor-or-self::tei:div4| ancestor-or-self::tei:div5| ancestor-or-self::tei:div6| ancestor-or-self::tei:div7)"/>
  </xsl:variable>
  <xsl:variable name="number">
    <xsl:number level="any"/>
  </xsl:variable>
  <xsl:variable name="getstyle" select="tei:get-headingstyle(.,$level)"/>
  <xsl:call-template name="block-element">
    <!-- we want a bookmark for referencing this section -->
    <xsl:with-param name="bookmark-id">
      <xsl:value-of select="1000+$number"/>
    </xsl:with-param>
    <xsl:with-param name="bookmark-name">
      <xsl:choose>
        <xsl:when test="parent::tei:div/@xml:id">
          <xsl:value-of select="parent::tei:div/@xml:id"/>
        </xsl:when>
        <xsl:when test="parent::tei:div1/@xml:id">
          <xsl:value-of select="parent::tei:div1/@xml:id"/>
        </xsl:when>
        <xsl:when test="parent::tei:div2/@xml:id">
          <xsl:value-of select="parent::tei:div2/@xml:id"/>
        </xsl:when>
        <xsl:when test="parent::tei:div3/@xml:id">
          <xsl:value-of select="parent::tei:div3/@xml:id"/>
        </xsl:when>
        <xsl:when test="parent::tei:div4/@xml:id">
          <xsl:value-of select="parent::tei:div4/@xml:id"/>
        </xsl:when>
        <xsl:when test="parent::tei:div5/@xml:id">
          <xsl:value-of select="parent::tei:div5/@xml:id"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>_SECTION_</xsl:text>
          <xsl:value-of select="1000+$number"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:with-param>
    <!-- find the correct header style -->
    <xsl:with-param name="style">
      <xsl:choose>
        <xsl:when test="$pPr//w:pStyle">
          <xsl:value-of select="$pPr//w:pStyle/@w:val"/>
        </xsl:when>
        <xsl:when test="string-length($getstyle) > 0">
          <xsl:call-template name="getStyleName">
            <xsl:with-param name="in" select="$getstyle"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:when test="parent::tei:div/parent::tei:back">
          <xsl:text>ANNEX</xsl:text>
        </xsl:when>
        <xsl:when test="ancestor::tei:back">
          <xsl:text>a</xsl:text>
          <xsl:value-of select="$level"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="getStyleName">
            <xsl:with-param name="in">
              <xsl:text>heading </xsl:text>
              <xsl:value-of select="$level"/>
            </xsl:with-param>
          </xsl:call-template>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:quote|tei:q|tei:said|tei:soCalled
Documentation

Description

 quoted text 
Namespace No namespace
Match tei:quote|tei:q|tei:said|tei:soCalled
Mode #default
References
Function
Template
Parameters
Import precedence 16
Source
<xsl:template match="tei:quote|tei:q|tei:said|tei:soCalled">
  <xsl:choose>
    <xsl:when test="*[not(tei:isInline(.))] or parent::tei:div">
      <xsl:call-template name="block-element">
        <xsl:with-param name="style">teiquote</xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="not(tei:isInline(.))">
      <xsl:call-template name="block-element">
        <xsl:with-param name="style">teiquote</xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="tei:l">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>
      <w:r>
        <w:t>
          <xsl:value-of select="$preQuote"/>
        </w:t>
      </w:r>
      <xsl:apply-templates/>
      <w:r>
        <w:t>
          <xsl:value-of select="$postQuote"/>
        </w:t>
      </w:r>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:hi[tei:match(@rend,'specList-elementSpec')]
Documentation

Description

 
        GI
    
Namespace No namespace
Match tei:hi[tei:match(@rend,'specList-elementSpec')]
Mode #default
References
Import precedence 16
Source
<xsl:template match="tei:hi[tei:match(@rend,'specList-elementSpec')]">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:gi|tei:tag
Namespace No namespace
Match tei:gi|tei:tag
Mode #default
Import precedence 16
Source
<xsl:template match="tei:gi|tei:tag">
  <w:r>
    <w:t><</w:t>
  </w:r>
  <xsl:apply-templates/>
  <w:r>
    <w:t>></w:t>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:caesura
Namespace No namespace
Match tei:caesura
Mode #default
Import precedence 16
Source
<xsl:template match="tei:caesura">
  <w:r>
    <w:t>   </w:t>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template teix:egXML|tei:p[tei:match(@rend,'eg')]
Documentation

Description

 
        Handle examples
    
Namespace No namespace
Match teix:egXML|tei:p[tei:match(@rend,'eg')]
Mode #default
References
Parameters
QName Namespace
highlight No namespace
simple No namespace
Import precedence 16
Source
<xsl:template match="teix:egXML|tei:p[tei:match(@rend,'eg')]">
  <xsl:param name="simple">false</xsl:param>
  <xsl:param name="highlight"/>
  <xsl:call-template name="block-element">
    <xsl:with-param name="select">
      <tei:p rend="Special">
        <xsl:attribute name="iso:style">
          <xsl:text>font-family:</xsl:text>
          <xsl:value-of select="$typewriterFont"/>
          <xsl:text>; font-size:18; text-align:left;</xsl:text>
        </xsl:attribute>
        <xsl:call-template name="create-egXML-section"/>
      </tei:p>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:eg
Namespace No namespace
Match tei:eg
Mode #default
References
Template
Parameter
Import precedence 16
Source
<xsl:template match="tei:eg">
  <xsl:variable name="content">
    <xsl:apply-templates select="*|processing-instruction()|comment()|text()" mode="egcopy"/>
  </xsl:variable>
  <xsl:for-each select="$content">
    <xsl:call-template name="block-element">
      <xsl:with-param name="style">Special</xsl:with-param>
      <xsl:with-param name="select">
        <tei:p rend="Special">
          <xsl:attribute name="iso:style">
            <xsl:text>font-family:</xsl:text>
            <xsl:value-of select="$typewriterFont"/>
            <xsl:text>; font-size:18; text-align:left;</xsl:text>
          </xsl:attribute>
          <xsl:copy-of select="*|processing-instruction()|comment()|text()"/>
        </tei:p>
      </xsl:with-param>
    </xsl:call-template>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template text()egcopy
Namespace No namespace
Match text()
Mode egcopy
Import precedence 16
Source
<xsl:template match="text()" mode="egcopy">
  <xsl:for-each select="tokenize(.,'\n')">
    <xsl:choose>
      <xsl:when test="position()=last()">
        <xsl:value-of select="."/>
      </xsl:when>
      <xsl:when test=".='' and position()=1">
        <xsl:value-of select="."/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="."/>
        <tei:lb rend="show"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template @*|comment()|processing-instruction()egcopy
Namespace No namespace
Match @*|comment()|processing-instruction()
Mode egcopy
Import precedence 16
Source
<xsl:template match="@*|comment()|processing-instruction()" mode="egcopy">
  <xsl:copy-of select="."/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template *egcopy
Namespace No namespace
Match *
Mode egcopy
Import precedence 16
Source
<xsl:template match="*" mode="egcopy">
  <xsl:copy>
    <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="egcopy"/>
  </xsl:copy>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:table
Documentation

Description

 
        Handle TEI tables 
    
Namespace No namespace
Match tei:table
Mode #default
References
Import precedence 16
Source
<xsl:template match="tei:table">
  <xsl:call-template name="table-body"/>
  <xsl:call-template name="table-header"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template table-body
Namespace No namespace
Used by
Template
References
Import precedence 16
Source
<xsl:template name="table-body">
  <w:tbl>
    <xsl:choose>
      <xsl:when test="w:tblPr">
        <xsl:copy-of select="w:tblPr"/>
      </xsl:when>
      <xsl:when test="tei:match(@rend,'attDef')">
        <w:tblPr>
          <w:tblW w:w="0" w:type="auto"/>
          <w:jc w:val="left"/>
          <w:tblBorders>
            <w:top w:val="nil" w:space="0" w:color="auto"/>
            <w:left w:val="nil" w:space="0" w:color="auto"/>
            <w:bottom w:val="nil" w:space="0" w:color="auto"/>
            <w:right w:val="nil" w:space="0" w:color="auto"/>
            <w:insideH w:val="nil" w:space="0" w:color="auto"/>
            <w:insideV w:val="nil" w:space="0" w:color="auto"/>
          </w:tblBorders>
        </w:tblPr>
      </xsl:when>
      <xsl:when test="tei:match(@rend,'attList')">
        <w:tblPr>
          <w:tblW w:w="0" w:type="auto"/>
          <w:jc w:val="left"/>
          <w:tblBorders>
            <w:top w:val="nil" w:space="0" w:color="auto"/>
            <w:left w:val="nil" w:space="0" w:color="auto"/>
            <w:bottom w:val="nil" w:space="0" w:color="auto"/>
            <w:right w:val="nil" w:space="0" w:color="auto"/>
            <w:insideH w:val="nil" w:space="0" w:color="auto"/>
            <w:insideV w:val="nil" w:space="0" w:color="auto"/>
          </w:tblBorders>
        </w:tblPr>
      </xsl:when>
      <xsl:when test="tei:match(@rend,'norules')">
        <w:tblPr>
          <w:tblW>
            <xsl:choose>
              <xsl:when test="not($tableWidthPercentage='')">
                <xsl:attribute name="w:w">
                  <xsl:value-of select="round(number($tableWidthPercentage)* 50)"/>
                </xsl:attribute>
                <xsl:attribute name="w:type">pct</xsl:attribute>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="w:w">0</xsl:attribute>
                <xsl:attribute name="w:type">auto</xsl:attribute>
              </xsl:otherwise>
            </xsl:choose>
          </w:tblW>
          <w:jc w:val="left"/>
          <w:tblBorders>
            <w:top w:val="nil" w:space="0" w:color="auto"/>
            <w:left w:val="nil" w:space="0" w:color="auto"/>
            <w:bottom w:val="nil" w:space="0" w:color="auto"/>
            <w:right w:val="nil" w:space="0" w:color="auto"/>
            <w:insideH w:val="nil" w:space="0" w:color="auto"/>
            <w:insideV w:val="nil" w:space="0" w:color="auto"/>
          </w:tblBorders>
        </w:tblPr>
      </xsl:when>
      <xsl:when test="tei:match(@rend,'wovenodd')">
        <w:tblPr>
          <w:tblW w:w="0" w:type="auto"/>
          <w:jc w:val="left"/>
          <w:tblBorders>
            <w:top w:val="single" w:sz="6" w:space="0" w:color="auto"/>
            <w:left w:val="single" w:sz="6" w:space="0" w:color="auto"/>
            <w:bottom w:val="single" w:sz="6" w:space="0" w:color="auto"/>
            <w:right w:val="single" w:sz="6" w:space="0" w:color="auto"/>
            <w:insideH w:val="single" w:sz="6" w:space="0" w:color="auto"/>
            <w:insideV w:val="single" w:sz="6" w:space="0" w:color="auto"/>
          </w:tblBorders>
        </w:tblPr>
      </xsl:when>
      <xsl:otherwise>
        <w:tblPr>
          <w:tblW>
            <xsl:choose>
              <xsl:when test="not($tableWidthPercentage='')">
                <xsl:attribute name="w:w">
                  <xsl:value-of select="round(number($tableWidthPercentage)* 50)"/>
                </xsl:attribute>
                <xsl:attribute name="w:type">pct</xsl:attribute>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="w:w">0</xsl:attribute>
                <xsl:attribute name="w:type">auto</xsl:attribute>
              </xsl:otherwise>
            </xsl:choose>
          </w:tblW>
          <w:jc w:val="center"/>
          <w:tblBorders>
            <w:top w:val="single" w:sz="6" w:space="0" w:color="auto"/>
            <w:left w:val="single" w:sz="6" w:space="0" w:color="auto"/>
            <w:bottom w:val="single" w:sz="6" w:space="0" w:color="auto"/>
            <w:right w:val="single" w:sz="6" w:space="0" w:color="auto"/>
            <w:insideH w:val="single" w:sz="6" w:space="0" w:color="auto"/>
            <w:insideV w:val="single" w:sz="6" w:space="0" w:color="auto"/>
          </w:tblBorders>
        </w:tblPr>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:choose>
      <xsl:when test="html:colgroup">
        <w:tblGrid>
          <xsl:for-each select="html:colgroup/html:col">
            <w:gridCol w:w="{tei:convert-dim-pt20(@width)}"/>
          </xsl:for-each>
        </w:tblGrid>
      </xsl:when>
      <!-- if it is defined in word's namespace -->
      <xsl:when test="w:tblGrid">
        <xsl:copy-of select="w:tblGrid"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:variable name="maxcols" select="max(.//tei:row/count(tei:cell))"/>
        <w:tblGrid>
          <xsl:for-each select="1 to $maxcols">
            <w:gridCol w:type="pct" w:w="{round((100 div $maxcols) *  50)}"/>
          </xsl:for-each>
        </w:tblGrid>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:apply-templates select="tei:row"/>
  </w:tbl>
  <w:p/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template table-header
Namespace No namespace
Used by
Template
References
Template
Import precedence 16
Source
<xsl:template name="table-header">
  <xsl:if test="tei:head">
    <xsl:variable name="number">
      <xsl:number level="any"/>
    </xsl:variable>
    <xsl:for-each select="tei:head[1]">
      <xsl:choose>
        <xsl:when test="../@xml:id">
          <xsl:call-template name="block-element">
            <xsl:with-param name="style">Tabletitle</xsl:with-param>
            <!-- we want a bookmark for referencing this table -->
            <xsl:with-param name="bookmark-id">
              <xsl:value-of select="1000+$number"/>
            </xsl:with-param>
            <xsl:with-param name="bookmark-name">
              <xsl:value-of select="../@xml:id"/>
            </xsl:with-param>
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="block-element">
            <xsl:with-param name="style">Tabletitle</xsl:with-param>
          </xsl:call-template>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:for-each>
  </xsl:if>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:row
Namespace No namespace
Match tei:row
Mode #default
Import precedence 16
Source
<xsl:template match="tei:row">
  <w:tr>
    <xsl:choose>
      <xsl:when test="w:trPr">
        <xsl:copy-of select="w:trPr"/>
      </xsl:when>
      <xsl:otherwise>
      </xsl:otherwise>
    </xsl:choose>
    <w:tblPrEx>
      <w:tblLayout w:type="autofit"/>
    </w:tblPrEx>
    <xsl:apply-templates select="tei:cell"/>
  </w:tr>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:cell
Namespace No namespace
Match tei:cell
Mode #default
References
Import precedence 16
Source
<xsl:template match="tei:cell">
  <w:tc>
    <xsl:choose>
      <xsl:when test="w:tcPr">
        <xsl:copy-of select="w:tcPr"/>
      </xsl:when>
      <xsl:otherwise>
        <w:tcPr>
          <!--w:tcW w:w="1915" w:type="dxa"/-->
          <xsl:if test="@cols">
            <w:gridSpan w:val="{@cols}"/>
          </xsl:if>
        </w:tcPr>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:choose>
      <xsl:when test="not(text()) and count(*)=1 and not(tei:isInline(*))">
        <xsl:apply-templates/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="block-element">
          <xsl:with-param name="pPr" as="node()*">
            <w:pPr>
              <xsl:choose>
                <xsl:when test="@rend">
                  <xsl:variable name="sName">
                    <xsl:call-template name="getStyleName">
                      <xsl:with-param name="in" select="@rend"/>
                    </xsl:call-template>
                  </xsl:variable>
                  <xsl:choose>
                    <xsl:when test="$sName=''">
                      <w:pStyle w:val="{$TableText}"/>
                    </xsl:when>
                    <xsl:otherwise>
                      <w:pStyle w:val="{$sName}"/>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:when>
                <xsl:otherwise>
                  <w:pStyle w:val="{$TableText}"/>
                </xsl:otherwise>
              </xsl:choose>
              <xsl:choose>
                <xsl:when test="@teidocx:align">
                  <w:jc w:val="{@teidocx:align}"/>
                </xsl:when>
                <xsl:when test="parent::tei:row[@role='label']          or @role='label'">
                  <w:jc w:val="left"/>
                </xsl:when>
                <xsl:when test="starts-with(.,'[0-9]')">
                  <w:jc w:val="right"/>
                </xsl:when>
                <xsl:otherwise>
                  <w:jc w:val="left"/>
                </xsl:otherwise>
              </xsl:choose>
            </w:pPr>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
    <!-- If we have no children, put an empty p here -->
    <xsl:if test="not(descendant::text())">
      <w:p>
        <w:pPr>
          <w:pStyle w:val="Tabletext9"/>
        </w:pPr>
        <w:r>
          <w:t/>
        </w:r>
      </w:p>
    </xsl:if>
  </w:tc>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template calculateTableBorders
Documentation

Description

Turn iso:style attribute back into Word styles for table, or work out some defaults based on @rowsep and @colsep
Namespace No namespace
Used by
Templates
Parameters
QName Namespace
htmlStyles No namespace
Import precedence 16
Source
<xsl:template name="calculateTableBorders">
  <xsl:param name="htmlStyles"/>
  <xsl:choose>
    <xsl:when test="$htmlStyles!=''">
      <xsl:for-each select="tokenize($htmlStyles,';')">
        <xsl:variable name="val">
          <xsl:value-of select="normalize-space(substring-after(.,':'))"/>
        </xsl:variable>
        <xsl:if test="matches(.,'border-top')">
          <xsl:choose>
            <xsl:when test="$val=0">
              <w:top w:val="nil"/>
            </xsl:when>
            <xsl:otherwise>
              <w:top w:val="single" w:sz="{$val}" w:space="0" w:color="auto"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:if>
        <xsl:if test="matches(.,'border-left')">
          <xsl:choose>
            <xsl:when test="$val=0">
              <w:left w:val="nil"/>
            </xsl:when>
            <xsl:otherwise>
              <w:left w:val="single" w:sz="{$val}" w:space="0" w:color="auto"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:if>
        <xsl:if test="matches(.,'border-bottom')">
          <xsl:choose>
            <xsl:when test="$val=0">
              <w:bottom w:val="nil"/>
            </xsl:when>
            <xsl:otherwise>
              <w:bottom w:val="single" w:sz="{$val}" w:space="0" w:color="auto"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:if>
        <xsl:if test="matches(.,'border-right')">
          <xsl:choose>
            <xsl:when test="$val=0">
              <w:right w:val="nil"/>
            </xsl:when>
            <xsl:otherwise>
              <w:right w:val="single" w:sz="{$val}" w:space="0" w:color="auto"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:if>
      </xsl:for-each>
    </xsl:when>
    <xsl:otherwise>
      <xsl:if test="@rowsep='1' or (not(@rowsep ='0') and ancestor::cals:tgroup/@rowsep='1')">
        <w:top w:val="single" w:sz="1"/>
      </xsl:if>
      <xsl:if test="@colsep='1' or (not(@colsep ='0') and ancestor::cals:tgroup/@colsep='1')">
        <w:left w:val="single" w:sz="1"/>
      </xsl:if>
      <xsl:if test="@rowsep='1' or (not(@rowsep ='0') and ancestor::cals:tgroup/@rowsep='1')">
        <w:bottom w:val="single" w:sz="1"/>
      </xsl:if>
      <xsl:if test="@colsep='1' or (not(@colsep ='0') and ancestor::cals:tgroup/@colsep='1')">
        <w:right w:val="single" w:sz="1"/>
      </xsl:if>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template cals:table
Documentation

Description

 Handle CALS tables 
Namespace No namespace
Match cals:table
Mode #default
References
Import precedence 16
Source
<xsl:template match="cals:table">
  <xsl:call-template name="tableheading-from-cals"/>
  <w:tbl>
    <w:tblPr>
      <w:tblW>
        <xsl:choose>
          <xsl:when test="not($tableWidthPercentage='')">
            <xsl:attribute name="w:w">
              <xsl:value-of select="round(number($tableWidthPercentage)* 50)"/>
            </xsl:attribute>
            <xsl:attribute name="w:type">pct</xsl:attribute>
          </xsl:when>
          <xsl:otherwise>
            <xsl:attribute name="w:w">0</xsl:attribute>
            <xsl:attribute name="w:type">auto</xsl:attribute>
          </xsl:otherwise>
        </xsl:choose>
      </w:tblW>
      <w:jc w:val="center"/>
      <w:tblBorders>
        <xsl:variable name="tblBorders">
          <xsl:call-template name="calculateTableBorders">
            <xsl:with-param name="htmlStyles">
              <xsl:value-of select="@iso:style"/>
            </xsl:with-param>
          </xsl:call-template>
        </xsl:variable>
        <xsl:choose>
          <!-- only @frame turns borders on/off. If a
		   border is 'on' *and* there is a corresponding 
		   border in $tblBorders (ie created from
		   info in iso:style) then the size from $tblBorders
		   overrides the default size -->
          <xsl:when test="@frame='none'">
            <w:top w:val="none" w:sz="0" w:space="0" w:color="auto"/>
            <w:left w:val="none" w:sz="0" w:space="0" w:color="auto"/>
            <w:bottom w:val="none" w:sz="0" w:space="0" w:color="auto"/>
            <w:right w:val="none" w:sz="0" w:space="0" w:color="auto"/>
          </xsl:when>
          <xsl:when test="@frame='top'">
            <xsl:choose>
              <xsl:when test="$tblBorders/w:top">
                <xsl:copy-of select="$tblBorders/w:top"/>
              </xsl:when>
              <xsl:otherwise>
                <w:top w:val="none" w:sz="6" w:space="0" w:color="auto"/>
              </xsl:otherwise>
            </xsl:choose>
            <w:left w:val="none" w:sz="0" w:space="0" w:color="auto"/>
            <w:bottom w:val="none" w:sz="0" w:space="0" w:color="auto"/>
            <w:right w:val="none" w:sz="0" w:space="0" w:color="auto"/>
          </xsl:when>
          <xsl:when test="@frame='bottom'">
            <w:top w:val="none" w:sz="0" w:space="0" w:color="auto"/>
            <w:left w:val="none" w:sz="0" w:space="0" w:color="auto"/>
            <xsl:choose>
              <xsl:when test="$tblBorders/w:bottom">
                <xsl:copy-of select="$tblBorders/w:bottom"/>
              </xsl:when>
              <xsl:otherwise>
                <w:bottom w:val="single" w:sz="6" w:space="0" w:color="auto"/>
              </xsl:otherwise>
            </xsl:choose>
            <w:right w:val="none" w:sz="0" w:space="0" w:color="auto"/>
          </xsl:when>
          <xsl:when test="@frame='topbot'">
            <xsl:choose>
              <xsl:when test="$tblBorders/w:top">
                <xsl:copy-of select="$tblBorders/w:top"/>
              </xsl:when>
              <xsl:otherwise>
                <w:top w:val="none" w:sz="6" w:space="0" w:color="auto"/>
              </xsl:otherwise>
            </xsl:choose>
            <w:left w:val="none" w:sz="0" w:space="0" w:color="auto"/>
            <xsl:choose>
              <xsl:when test="$tblBorders/w:bottom">
                <xsl:copy-of select="$tblBorders/w:bottom"/>
              </xsl:when>
              <xsl:otherwise>
                <w:bottom w:val="single" w:sz="6" w:space="0" w:color="auto"/>
              </xsl:otherwise>
            </xsl:choose>
            <w:right w:val="none" w:sz="0" w:space="0" w:color="auto"/>
          </xsl:when>
          <xsl:when test="@frame='sides'">
            <w:top w:val="none" w:sz="0" w:space="0" w:color="auto"/>
            <xsl:choose>
              <xsl:when test="$tblBorders/w:left">
                <xsl:copy-of select="$tblBorders/w:left"/>
              </xsl:when>
              <xsl:otherwise>
                <w:left w:val="single" w:sz="6" w:space="0" w:color="auto"/>
              </xsl:otherwise>
            </xsl:choose>
            <w:bottom w:val="none" w:sz="0" w:space="0" w:color="auto"/>
            <xsl:choose>
              <xsl:when test="$tblBorders/w:right">
                <xsl:copy-of select="$tblBorders/w:right"/>
              </xsl:when>
              <xsl:otherwise>
                <w:right w:val="single" w:sz="6" w:space="0" w:color="auto"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:when>
          <xsl:when test="@frame='all'">
            <xsl:choose>
              <xsl:when test="$tblBorders/w:top">
                <xsl:copy-of select="$tblBorders/w:top"/>
              </xsl:when>
              <xsl:otherwise>
                <w:top w:val="single" w:sz="6" w:space="0" w:color="auto"/>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:choose>
              <xsl:when test="$tblBorders/w:left">
                <xsl:copy-of select="$tblBorders/w:left"/>
              </xsl:when>
              <xsl:otherwise>
                <w:left w:val="single" w:sz="6" w:space="0" w:color="auto"/>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:choose>
              <xsl:when test="$tblBorders/w:bottom">
                <xsl:copy-of select="$tblBorders/w:bottom"/>
              </xsl:when>
              <xsl:otherwise>
                <w:bottom w:val="single" w:sz="6" w:space="0" w:color="auto"/>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:choose>
              <xsl:when test="$tblBorders/w:right">
                <xsl:copy-of select="$tblBorders/w:right"/>
              </xsl:when>
              <xsl:otherwise>
                <w:right w:val="single" w:sz="6" w:space="0" w:color="auto"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:when>
        </xsl:choose>
        <xsl:choose>
          <xsl:when test="@rowsep=1">
            <w:insideH w:val="single" w:sz="6" w:space="0" w:color="auto"/>
          </xsl:when>
          <xsl:otherwise>
            <w:insideH w:val="none" w:sz="6" w:space="0" w:color="auto"/>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:choose>
          <xsl:when test="@colsep=1">
            <w:insideV w:val="single" w:sz="6" w:space="0" w:color="auto"/>
          </xsl:when>
          <xsl:otherwise>
            <w:insideV w:val="none" w:sz="6" w:space="0" w:color="auto"/>
          </xsl:otherwise>
        </xsl:choose>
      </w:tblBorders>
      <w:tblLayout w:type="fixed"/>
    </w:tblPr>
    <xsl:variable name="maxcols" select="max(.//cals:row/count(cals:entry))"/>
    <xsl:choose>
      <xsl:when test="cals:tgroup/cals:colspec">
        <w:tblGrid>
          <xsl:variable name="totunits" select="sum(cals:tgroup/cals:colspec[ends-with(@colwidth,'*')]/number(substring-before(@colwidth,'*')))"/>
          <xsl:for-each select="cals:tgroup/cals:colspec">
            <w:gridCol>
              <xsl:choose>
                <!-- cell widths are specified in 50th of a percent -->
                <xsl:when test="ends-with(@colwidth,'*')">
                  <xsl:attribute name="w:type">pct</xsl:attribute>
                  <xsl:attribute name="w:w">
                    <xsl:value-of select="round((number(substring-before(@colwidth,'*')) * 5000) div $totunits)"/>
                  </xsl:attribute>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:attribute name="w:w">
                    <xsl:value-of select="tei:convert-dim-pt20(@colwidth)"/>
                  </xsl:attribute>
                </xsl:otherwise>
              </xsl:choose>
            </w:gridCol>
          </xsl:for-each>
        </w:tblGrid>
      </xsl:when>
      <xsl:otherwise>
        <w:tblGrid>
          <xsl:for-each select="1 to $maxcols">
            <w:gridCol w:type="pct" w:w="{round((100 div $maxcols) *  50)}"/>
          </xsl:for-each>
        </w:tblGrid>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:apply-templates select="cals:tgroup"/>
  </w:tbl>
  <w:p/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tableheading-from-cals
Namespace No namespace
Used by
Template
References
Import precedence 16
Source
<xsl:template name="tableheading-from-cals">
  <xsl:if test="cals:title">
    <xsl:for-each select="cals:title[1]">
      <w:p>
        <w:pPr>
          <w:pStyle>
            <xsl:attribute name="w:val">Tabletitle</xsl:attribute>
          </w:pStyle>
        </w:pPr>
        <xsl:if test="not(normalize-space(.)='')">
          <w:r>
            <w:t xml:space="preserve"></w:t>
          </w:r>
        </xsl:if>
        <xsl:apply-templates/>
      </w:p>
    </xsl:for-each>
    <xsl:for-each select="preceding-sibling::tei:p[tei:match(@rend,'Table units')]">
      <w:p>
        <w:pPr>
          <w:pStyle>
            <xsl:attribute name="w:val">Tableunits</xsl:attribute>
          </w:pStyle>
        </w:pPr>
        <xsl:apply-templates/>
      </w:p>
    </xsl:for-each>
  </xsl:if>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template cals:tgroup
Namespace No namespace
Match cals:tgroup
Mode #default
Import precedence 16
Source
<xsl:template match="cals:tgroup">
  <xsl:variable name="TABLE">
    <xsl:copy>
      <xsl:attribute name="iso:style">
        <xsl:copy-of select="ancestor::cals:table/@iso:style"/>
      </xsl:attribute>
      <xsl:copy-of select="@*"/>
      <xsl:copy-of select="cals:colspec"/>
      <xsl:for-each select="cals:tbody|cals:thead">
        <xsl:copy>
          <xsl:for-each select="cals:row">
            <xsl:copy>
              <xsl:copy-of select="@*"/>
              <xsl:for-each select="cals:entry">
                <xsl:copy>
                  <xsl:copy-of select="@*"/>
                  <xsl:apply-templates mode="contents" select="."/>
                </xsl:copy>
                <xsl:variable name="rows" select="@rowsep"/>
                <xsl:variable name="cols" select="@colsep"/>
                <xsl:choose>
                  <xsl:when test="@namest and ancestor::cals:tgroup/cals:colspec[@colname=current()/@namest]">
                    <xsl:variable name="start">
                      <xsl:for-each select="ancestor::cals:tgroup/cals:colspec[@colname=current()/@namest]">
                        <xsl:choose>
                          <xsl:when test="@colnum">
                            <xsl:value-of select="@colnum"/>
                          </xsl:when>
                          <xsl:otherwise>
                            <xsl:number/>
                          </xsl:otherwise>
                        </xsl:choose>
                      </xsl:for-each>
                    </xsl:variable>
                    <xsl:variable name="end">
                      <xsl:for-each select="ancestor::cals:tgroup/cals:colspec[@colname=current()/@nameend]">
                        <xsl:choose>
                          <xsl:when test="@colnum">
                            <xsl:value-of select="@colnum"/>
                          </xsl:when>
                          <xsl:otherwise>
                            <xsl:number/>
                          </xsl:otherwise>
                        </xsl:choose>
                      </xsl:for-each>
                    </xsl:variable>
                    <xsl:for-each select="ancestor::cals:tgroup/cals:colspec[position()>$start and position()<=$end]">
                      <cals:entry DUMMY="true" colname="{@colname}" colsep="{$cols}" rowsep="{$rows}"/>
                    </xsl:for-each>
                  </xsl:when>
                  <xsl:when test="@namest">
                    <xsl:message terminate="yes">ERROR Column
                      <xsl:value-of select="@namest"/>
                      <xsl:text> referenced with @namest attribute </xsl:text>
                      <xsl:text>is not named in the list of  <colspec> elements for this table</xsl:text>
                    </xsl:message>
                  </xsl:when>
                </xsl:choose>
              </xsl:for-each>
            </xsl:copy>
          </xsl:for-each>
        </xsl:copy>
      </xsl:for-each>
    </xsl:copy>
  </xsl:variable>
  <!--
	<xsl:variable name="count">
	  <xsl:number level="any"/>
	</xsl:variable>
	  <xsl:result-document indent="yes" href="/tmp/T{$count}.xml">
	    <xsl:copy-of select="$TABLE"/>
	  </xsl:result-document>
-->
  <xsl:for-each select="$TABLE/cals:tgroup">
    <xsl:apply-templates/>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template cals:row
Namespace No namespace
Match cals:row
Mode #default
Import precedence 16
Source
<xsl:template match="cals:row">
  <xsl:variable name="borders">
    <xsl:if test="@colsep='1' or (not(@colsep ='0') and ancestor::cals:tgroup/@colsep='1')">
      <w:left w:val="single" w:sz="1"/>
    </xsl:if>
  </xsl:variable>
  <xsl:variable name="ROWPOS">
    <xsl:number/>
  </xsl:variable>
  <xsl:variable name="TEMPLATE">
    <xsl:for-each select="ancestor::cals:tgroup/cals:colspec">
      <CELL name="{@colname}" num="{@colnum}" rowpos="{$ROWPOS}"/>
    </xsl:for-each>
  </xsl:variable>
  <xsl:variable name="lastColnum">
    <xsl:value-of select="ancestor::cals:tgroup/cals:colspec[last()]/@colnum"/>
  </xsl:variable>
  <xsl:variable name="lastColname">
    <xsl:value-of select="ancestor::cals:tgroup/cals:colspec[last()]/@colname"/>
  </xsl:variable>
  <xsl:variable name="ME" select="."/>
  <xsl:variable name="topEdge">
    <xsl:choose>
      <xsl:when test="parent::cals:tbody">
        <xsl:if test="not(parent::cals:tbody/preceding-sibling::cals:thead/cals:row)">true</xsl:if>
      </xsl:when>
      <xsl:otherwise>
        <xsl:if test="not(preceding-sibling::cals:row)">true</xsl:if>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="bottomEdge">
    <xsl:choose>
      <xsl:when test="parent::cals:thead">
        <xsl:if test="not(parent::cals:thead/following-sibling::cals:tbody/cals:row)">true</xsl:if>
      </xsl:when>
      <xsl:otherwise>
        <xsl:if test="not(following-sibling::cals:row)">true</xsl:if>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <w:tr>
    <w:tblPrEx>
      <w:tblLayout w:type="autofit"/>
    </w:tblPrEx>
    <xsl:for-each select="$TEMPLATE/CELL">
      <xsl:variable name="N" select="@name"/>
      <xsl:variable name="leftEdge">
        <xsl:choose>
          <xsl:when test="$N='c1' or $N='1'">true</xsl:when>
          <xsl:when test="not(preceding-sibling::CELL)">true</xsl:when>
        </xsl:choose>
      </xsl:variable>
      <xsl:variable name="rightEdge">
        <xsl:choose>
          <xsl:when test="not(following-sibling::CELL)">true</xsl:when>
        </xsl:choose>
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="$ME/cals:entry[@colname=$N and @DUMMY='true']"/>
        <xsl:when test="$ME/cals:entry[@colname=$N]">
          <xsl:apply-templates select="$ME/cals:entry[@colname=$N]">
            <xsl:with-param name="topEdge" select="$topEdge"/>
            <xsl:with-param name="bottomEdge" select="$bottomEdge"/>
            <xsl:with-param name="leftEdge" select="$leftEdge"/>
            <xsl:with-param name="rightEdge" select="$rightEdge"/>
          </xsl:apply-templates>
        </xsl:when>
        <xsl:otherwise>
          <w:tc>
            <w:tcPr>
              <w:vMerge/>
              <xsl:if test="$borders/w:left">
                <w:tcBorders>
                  <xsl:copy-of select="$borders/w:left"/>
                </w:tcBorders>
              </xsl:if>
            </w:tcPr>
            <w:p>
            </w:p>
          </w:tc>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:for-each>
  </w:tr>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template cals:entry
Namespace No namespace
Match cals:entry
Mode #default
References
Parameters
QName Namespace
bottomEdge No namespace
leftEdge No namespace
rightEdge No namespace
topEdge No namespace
Import precedence 16
Source
<xsl:template match="cals:entry">
  <xsl:param name="topEdge"/>
  <xsl:param name="bottomEdge"/>
  <xsl:param name="leftEdge"/>
  <xsl:param name="rightEdge"/>
  <xsl:variable name="cellBorders">
    <xsl:call-template name="calculateTableBorders">
      <xsl:with-param name="htmlStyles">
        <xsl:value-of select="@iso:style"/>
      </xsl:with-param>
    </xsl:call-template>
  </xsl:variable>
  <xsl:variable name="tableBorders">
    <xsl:call-template name="calculateTableBorders">
      <xsl:with-param name="htmlStyles">
        <xsl:value-of select="ancestor::cals:tgroup/@iso:style"/>
      </xsl:with-param>
    </xsl:call-template>
  </xsl:variable>
  <xsl:variable name="colname" select="@colname"/>
  <w:tc>
    <w:tcPr>
      <xsl:if test="@namest">
        <xsl:variable name="start">
          <xsl:for-each select="ancestor::cals:tgroup/cals:colspec[@colname=current()/@namest]">
            <xsl:choose>
              <xsl:when test="@colnum">
                <xsl:value-of select="@colnum"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:number/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:for-each>
        </xsl:variable>
        <xsl:variable name="end">
          <xsl:for-each select="ancestor::cals:tgroup/cals:colspec[@colname=current()/@nameend]">
            <xsl:choose>
              <xsl:when test="@colnum">
                <xsl:value-of select="@colnum"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:number/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:for-each>
        </xsl:variable>
        <w:gridSpan w:val="{number($end)-number($start)+1}"/>
      </xsl:if>
      <xsl:if test="@morerows">
        <w:vMerge w:val="restart"/>
      </xsl:if>
      <!--
	    <xsl:message><xsl:value-of select="$colname"/>
	    (<xsl:value-of select="."/>):    <xsl:value-of
	    select="@rowsep"/> and <xsl:value-of
	    select="parent::cals:row/preceding-sibling::cals:row[1]/cals:entry[@colname=$colname]/@rowsep"/></xsl:message>
	    -->
      <xsl:variable name="borders">
        <!-- top border -->
        <xsl:choose>
          <xsl:when test="parent::cals:row/preceding-sibling::cals:row[1]/cals:entry[@colname=$colname]/@rowsep=0">
            <w:top w:val="nil"/>
          </xsl:when>
          <xsl:when test="$topEdge='true'">
            <!-- HERE -->
            <xsl:if test="$tableBorders/w:top[@w:sz]">
              <w:top w:val="single" w:sz="{$tableBorders/w:top/@w:sz}" w:space="0" w:color="auto"/>
            </xsl:if>
          </xsl:when>
          <xsl:when test="@rowsep=0">
            <w:top w:val="nil"/>
          </xsl:when>
          <xsl:when test="$cellBorders/w:top">
            <xsl:copy-of select="$cellBorders/w:top"/>
          </xsl:when>
        </xsl:choose>
        <!-- left border -->
        <xsl:choose>
          <xsl:when test="$leftEdge='true'">
            <xsl:if test="$tableBorders/w:left[@w:sz]">
              <w:left w:val="single" w:sz="{$tableBorders/w:left/@w:sz}" w:space="0" w:color="auto"/>
            </xsl:if>
          </xsl:when>
          <xsl:when test="$cellBorders/w:left">
            <xsl:copy-of select="$cellBorders/w:left"/>
          </xsl:when>
        </xsl:choose>
        <!-- bottom border -->
        <xsl:choose>
          <xsl:when test="$bottomEdge='true'">
            <xsl:if test="$tableBorders/w:bottom[@w:sz]">
              <w:bottom w:val="single" w:sz="{$tableBorders/w:bottom/@w:sz}" w:space="0" w:color="auto"/>
            </xsl:if>
          </xsl:when>
          <xsl:when test="@rowsep=0 or parent::cals:row/@rowsep=0">
            <w:bottom w:val="nil"/>
          </xsl:when>
          <xsl:when test="@rowsep=1 or parent::cals:row/@rowsep=1">
            <xsl:choose>
              <xsl:when test="$cellBorders/w:bottom">
                <xsl:copy-of select="$cellBorders/w:bottom"/>
              </xsl:when>
              <xsl:otherwise>
                <w:bottom w:val="single" w:sz="6" w:space="0" w:color="auto"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:when>
        </xsl:choose>
        <!-- right border -->
        <xsl:choose>
          <xsl:when test="following-sibling::cals:entry[1]/@colsep=0">
            <w:right w:val="nil"/>
          </xsl:when>
          <xsl:when test="$rightEdge='true'">
            <xsl:if test="$tableBorders/w:right[@w:sz]">
              <w:right w:val="single" w:sz="{$tableBorders/w:right/@w:sz}" w:space="0" w:color="auto"/>
            </xsl:if>
          </xsl:when>
          <xsl:when test="@colsep=0">
            <w:right w:val="nil"/>
          </xsl:when>
          <xsl:when test="@colsep=1">
            <xsl:choose>
              <xsl:when test="$cellBorders/w:right">
                <xsl:copy-of select="$cellBorders/w:right"/>
              </xsl:when>
              <xsl:otherwise>
                <w:right w:val="single" w:sz="6" w:space="0" w:color="auto"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:when>
        </xsl:choose>
      </xsl:variable>
      <xsl:if test="$borders/*">
        <w:tcBorders>
          <xsl:copy-of select="$borders/w:top"/>
          <xsl:copy-of select="$borders/w:left"/>
          <xsl:copy-of select="$borders/w:bottom"/>
          <xsl:copy-of select="$borders/w:right"/>
        </w:tcBorders>
      </xsl:if>
      <xsl:if test="@rotate='1'">
        <w:textDirection w:val="btLr"/>
      </xsl:if>
      <xsl:if test="@valign">
        <w:vAlign>
          <xsl:attribute name="w:val">
            <xsl:attribute name="valign">
              <xsl:choose>
                <xsl:when test="@valign='middle'">center</xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="@valign"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:attribute>
          </xsl:attribute>
        </w:vAlign>
      </xsl:if>
    </w:tcPr>
    <xsl:copy-of select="*"/>
  </w:tc>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template cals:entrycontents
Namespace No namespace
Match cals:entry
Mode contents
References
Templates
Variable
Import precedence 16
Source
<xsl:template match="cals:entry" mode="contents">
  <xsl:call-template name="block-element">
    <xsl:with-param name="pPr" as="node()*">
      <w:pPr>
        <xsl:choose>
          <xsl:when test="@rend">
            <xsl:variable name="sName">
              <xsl:call-template name="getStyleName">
                <xsl:with-param name="in" select="@rend"/>
              </xsl:call-template>
            </xsl:variable>
            <xsl:choose>
              <xsl:when test="$sName=''">
                <w:pStyle w:val="{$TableText}"/>
              </xsl:when>
              <xsl:otherwise>
                <w:pStyle w:val="{$sName}"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:when>
          <xsl:otherwise>
            <w:pStyle w:val="{$TableText}"/>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:choose>
          <xsl:when test="@align">
            <w:jc w:val="{@align}"/>
          </xsl:when>
          <xsl:when test="parent::tei:row[@role='label']    or @role='label'">
            <w:jc w:val="left"/>
          </xsl:when>
          <xsl:when test="starts-with(.,'[0-9]')">
            <w:jc w:val="right"/>
          </xsl:when>
          <xsl:otherwise>
            <w:jc w:val="left"/>
          </xsl:otherwise>
        </xsl:choose>
      </w:pPr>
    </xsl:with-param>
    <xsl:with-param name="nop">
      <xsl:choose>
        <xsl:when test="not(text()) and tei:note[(not(@place))]">true</xsl:when>
        <!--NEN: next when commented to make footnotes in table possible-->
        <!--<xsl:when test="not(text()) and tei:note[@place='foot']">true</xsl:when>-->
        <xsl:otherwise>false</xsl:otherwise>
      </xsl:choose>
    </xsl:with-param>
  </xsl:call-template>
  <!-- If we have no children, put an empty p here -->
  <xsl:choose>
    <xsl:when test="*"/>
    <xsl:when test="text()"/>
    <xsl:otherwise>
      <w:p>
        <w:pPr>
          <w:pStyle w:val="Tabletext9"/>
        </w:pPr>
        <w:r>
          <w:t/>
        </w:r>
      </w:p>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:g[@ref='x:tab']
Documentation

Description

 
	 Inline Templates:
    
Namespace No namespace
Match tei:g[@ref='x:tab']
Mode #default
Import precedence 16
Source
<xsl:template match="tei:g[@ref='x:tab']">
  <w:r>
    <w:tab/>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:c[tei:match(@rend,'ptab')]
Namespace No namespace
Match tei:c[tei:match(@rend,'ptab')]
Mode #default
References
Import precedence 16
Source
<xsl:template match="tei:c[tei:match(@rend,'ptab')]">
  <w:r>
    <w:ptab w:relativeTo="margin" w:alignment="{@type}" w:leader="none"/>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template lineBreak
Namespace No namespace
Used by
Template
Supersedes
Template
Import precedence 16
Source
<xsl:template name="lineBreak">
  <w:r>
    <w:br/>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template lineBreakAsPara
Namespace No namespace
Used by
Template
Supersedes
Template
Import precedence 16
Source
<xsl:template name="lineBreakAsPara">
  <w:r>
    <w:br/>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:ptr[@cRef]
Documentation

Description

 hyperlink 
Namespace No namespace
Match tei:ptr[@cRef]
Mode #default
Import precedence 16
Source
<xsl:template match="tei:ptr[@cRef]">
  <w:r>
    <w:rPr>
      <w:u w:val="single"/>
    </w:rPr>
    <w:t>
      <xsl:value-of select="@cRef"/>
    </w:t>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:ptr[@target]
Namespace No namespace
Match tei:ptr[@target]
Mode #default
References
Import precedence 16
Source
<xsl:template match="tei:ptr[@target]">
  <xsl:variable name="multi" select="if (contains(@target,' '))            then true() else false()"/>
  <xsl:variable name="xmllang" select="@xml:lang"/>
  <xsl:variable name="context" select="."/>
  <xsl:for-each select="tokenize(@target,' ')">
    <xsl:variable name="target" select="."/>
    <xsl:variable name="pos" select="position()"/>
    <xsl:for-each select="$context">
      <xsl:variable name="a">
        <xsl:choose>
          <xsl:when test="@type='cit'">[</xsl:when>
          <xsl:when test="@type='figure'">
            <xsl:sequence select="tei:i18n('figureWord')"/>
            <xsl:text> </xsl:text>
          </xsl:when>
          <xsl:when test="@type='table'">
            <xsl:sequence select="tei:i18n('tableWord')"/>
            <xsl:text> </xsl:text>
          </xsl:when>
        </xsl:choose>
        <xsl:choose>
          <xsl:when test="starts-with($target,'#')  and  id(substring($target,2))">
            <xsl:apply-templates select="id(substring($target,2))" mode="xref"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:sequence select="tei:resolveURI(.,$target)"/>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:if test="@type='cit'">]</xsl:if>
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="starts-with($target,'#') and id(substring($target,2))">
          <xsl:call-template name="linkMe">
            <xsl:with-param name="target" select="$target"/>
            <xsl:with-param name="context" select="$context"/>
            <xsl:with-param name="anchor" select="$a"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="linkMeUsingHyperlink">
            <xsl:with-param name="target" select="$target"/>
            <xsl:with-param name="context" select="$context"/>
            <xsl:with-param name="anchor" select="$a"/>
            <xsl:with-param name="position" select="$pos"/>
          </xsl:call-template>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:for-each>
    <xsl:if test="$multi">
      <w:r>
        <w:t>
          <xsl:attribute name="xml:space">preserve</xsl:attribute>
          <xsl:call-template name="multiTargetSeparator">
            <xsl:with-param name="xmllang" select="$xmllang"/>
          </xsl:call-template>
        </w:t>
      </w:r>
    </xsl:if>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:ref[@target]
Namespace No namespace
Match tei:ref[@target]
Mode #default
References
Import precedence 16
Source
<xsl:template match="tei:ref[@target]">
  <xsl:variable name="context" select="."/>
  <xsl:variable name="a">
    <xsl:apply-templates/>
  </xsl:variable>
  <xsl:variable name="xmllang" select="@xml:lang"/>
  <xsl:variable name="multi" select="if (contains(@target,' '))            then true() else false()"/>
  <xsl:for-each select="tokenize(@target,' ')">
    <xsl:variable name="target" select="."/>
    <xsl:variable name="pos" select="position()"/>
    <xsl:variable name="rContent">
      <xsl:for-each select="$context">
        <xsl:choose>
          <xsl:when test="starts-with($target,'#') and id(substring($target,2))">
            <xsl:call-template name="linkMe">
              <xsl:with-param name="target" select="$target"/>
              <xsl:with-param name="context" select="$context"/>
              <xsl:with-param name="anchor" select="$a"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <xsl:call-template name="linkMeUsingHyperlink">
              <xsl:with-param name="target" select="$target"/>
              <xsl:with-param name="context" select="$context"/>
              <xsl:with-param name="anchor" select="$a"/>
              <xsl:with-param name="position" select="$pos"/>
            </xsl:call-template>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
    </xsl:variable>
    <xsl:choose>
      <xsl:when test="tei:isInline($context)">
        <xsl:copy-of select="$rContent"/>
      </xsl:when>
      <xsl:otherwise>
        <w:p>
          <xsl:copy-of select="$rContent"/>
        </w:p>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:if test="$multi">
      <w:r>
        <w:t>
          <xsl:attribute name="xml:space">preserve</xsl:attribute>
          <xsl:call-template name="multiTargetSeparator">
            <xsl:with-param name="xmllang" select="$xmllang"/>
          </xsl:call-template>
        </w:t>
      </w:r>
    </xsl:if>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template linkMeUsingHyperlink
Namespace No namespace
Used by
Parameters
Import precedence 16
Source
Stylesheet location ../../../docx/to/teitodocx.xsl
Template linkMe
Namespace No namespace
Used by
References
Parameters
QName Namespace
anchor No namespace
context No namespace
target No namespace
Import precedence 16
Source
<xsl:template name="linkMe">
  <xsl:param name="anchor"/>
  <xsl:param name="context"/>
  <xsl:param name="target"/>
  <xsl:for-each select="$context">
    <!-- create the field codes for the complex field -->
    <!-- based on information in tei:ref/@tei:rend -->
    <xsl:variable name="instrText">
      <xsl:choose>
        <xsl:when test="starts-with($target,'#')">
          <xsl:variable name="goto" select="substring($target,2)"/>
          <xsl:choose>
            <xsl:when test="tei:match(@rend,'noteref')">
              <xsl:text>NOTEREF </xsl:text>
            </xsl:when>
            <xsl:otherwise>
              <xsl:text>REF </xsl:text>
            </xsl:otherwise>
          </xsl:choose>
          <xsl:value-of select="$goto"/>
          <xsl:for-each select="id($goto)">
            <xsl:choose>
              <xsl:when test="tei:match(@rend,'instr_')">
                <xsl:if test="tei:match(@rend,'instr_f')">
                  <xsl:text> \f</xsl:text>
                </xsl:if>
                <xsl:if test="tei:match(@rend,'instr_r')">
                  <xsl:text> \r</xsl:text>
                </xsl:if>
                <xsl:if test="tei:match(@rend,'instr_n')">
                  <xsl:text> \n</xsl:text>
                </xsl:if>
              </xsl:when>
              <xsl:when test="@type='refdoc'"/>
              <xsl:otherwise>
                <xsl:text> \n</xsl:text>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:for-each>
          <xsl:text> \h</xsl:text>
          <xsl:if test="tei:match(@rend,'mergeformat')">
            <xsl:text> \* MERGEFORMAT</xsl:text>
          </xsl:if>
        </xsl:when>
        <xsl:otherwise>
          <xsl:sequence select="tei:resolveURI(.,$target)"/>
          <xsl:text>" \h</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <w:r>
      <w:fldChar w:fldCharType="begin"/>
    </w:r>
    <w:r>
      <w:instrText>
        <xsl:value-of select="$instrText"/>
      </w:instrText>
    </w:r>
    <w:r>
      <w:fldChar w:fldCharType="separate"/>
    </w:r>
    <w:r>
      <xsl:variable name="rPr">
        <xsl:apply-templates>
          <xsl:with-param name="character-style" select="@iso:class"/>
        </xsl:apply-templates>
      </xsl:variable>
      <w:rPr>
        <xsl:if test="$rPr/w:r/w:rPr/w:rStyle/@w:val">
          <w:rStyle w:val="{$rPr/w:r/w:rPr/w:rStyle/@w:val}"/>
        </xsl:if>
        <xsl:copy-of select="$anchor/w:r/w:rPr/*[not(self::w:rStyle)]"/>
        <!-- oucs0037: why are we overriding special font styles??
	       Comment this out for now! -->
        <!--	  <xsl:if test="ancestor::tei:p[tei:match(@rend,'Special')]">
	    <w:rFonts w:ascii="Courier New" w:hAnsi="Courier New"/>
	  </xsl:if> -->
        <xsl:if test="$rPr/w:r/w:rPr/w:rStyle/@w:val='Hyperlink'">
          <w:u w:val="none"/>
        </xsl:if>
      </w:rPr>
      <xsl:choose>
        <xsl:when test="$anchor/w:r">
          <xsl:copy-of select="$anchor/w:r/w:t"/>
        </xsl:when>
        <xsl:otherwise>
          <w:t>
            <xsl:copy-of select="$anchor"/>
          </w:t>
        </xsl:otherwise>
      </xsl:choose>
    </w:r>
    <w:r>
      <w:fldChar w:fldCharType="end"/>
    </w:r>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:bibl|tei:biblStructxref
Namespace No namespace
Match tei:bibl|tei:biblStruct
Mode xref
Import precedence 16
Source
<xsl:template match="tei:bibl|tei:biblStruct" mode="xref">
  <xsl:number/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:note|tei:itemxref
Namespace No namespace
Match tei:note|tei:item
Mode xref
Import precedence 16
Source
<xsl:template match="tei:note|tei:item" mode="xref">
  <xsl:number/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:divxref
Namespace No namespace
Match tei:div
Mode xref
Import precedence 16
Source
<xsl:template match="tei:div" mode="xref">
  <xsl:choose>
    <xsl:when test="ancestor::tei:front">
      <xsl:number count="tei:div" from="tei:front" format="i" level="multiple"/>
    </xsl:when>
    <xsl:when test="ancestor::tei:body">
      <xsl:number count="tei:div" from="tei:body" format="1" level="multiple"/>
    </xsl:when>
    <xsl:when test="ancestor::tei:back">Annex
      <xsl:number count="tei:div" from="tei:back" format="A.1.1" level="multiple"/>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template w:drawing
Documentation

Description

 
        Handle elements from different namespaces, such as wordML, wordMathML, MathML ...
        
Namespace No namespace
Match w:drawing
Mode #default
Import precedence 16
Source
<xsl:template match="w:drawing">
  <w:r>
    <xsl:apply-templates select="." mode="iden"/>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template iso:wordObject
Namespace No namespace
Match iso:wordObject
Mode #default
Import precedence 16
Source
<xsl:template match="iso:wordObject">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template w:*
Namespace No namespace
Match w:*
Mode #default
Import precedence 16
Source
<xsl:template match="w:*">
  <xsl:if test="ancestor::w:tbl">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:if>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template getStyleFonts
Documentation

Description

 place holders, used by ISO profile 
Namespace No namespace
Used by
Template
Parameters
QName Namespace
css No namespace
Import precedence 16
Source
<xsl:template name="getStyleFonts">
  <xsl:param name="css"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:revisionDesc
Documentation

Description

 revisionDesc 
Namespace No namespace
Match tei:revisionDesc
Mode #default
Import precedence 16
Source
<xsl:template match="tei:revisionDesc"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:index
Documentation

Description

 no handling of index terms 
Namespace No namespace
Match tei:index
Mode #default
Import precedence 16
Source
<xsl:template match="tei:index"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template applyRendition
Namespace No namespace
Import precedence 16
Source
<xsl:template name="applyRendition"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template emphasize
Namespace No namespace
Used by
Parameters
QName Namespace
class No namespace
content No namespace
Import precedence 16
Source
<xsl:template name="emphasize">
  <xsl:param name="class"/>
  <xsl:param name="content"/>
  <w:r>
    <xsl:choose>
      <xsl:when test="$class='titlem'">
        <w:rPr>
          <w:i/>
        </w:rPr>
      </xsl:when>
      <xsl:when test="$class='titlej'">
        <w:rPr>
          <w:i/>
        </w:rPr>
      </xsl:when>
    </xsl:choose>
    <w:t>
      <xsl:attribute name="xml:space">preserve</xsl:attribute>
      <xsl:choose>
        <xsl:when test="$class='titles'">
          <xsl:text>, </xsl:text>
        </xsl:when>
        <xsl:when test="$class='titleu'">
          <xsl:text></xsl:text>
        </xsl:when>
        <xsl:when test="$class='titlea'">
          <xsl:text></xsl:text>
        </xsl:when>
      </xsl:choose>
      <xsl:value-of select="$content"/>
      <xsl:choose>
        <xsl:when test="$class='titleu'">
          <xsl:text></xsl:text>
        </xsl:when>
        <xsl:when test="$class='titlea'">
          <xsl:text></xsl:text>
        </xsl:when>
      </xsl:choose>
    </w:t>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:listBibl
Documentation

Description

 List Bibl 
Namespace No namespace
Match tei:listBibl
Mode #default
References
Template
Import precedence 16
Source
<xsl:template match="tei:listBibl">
  <xsl:for-each select="*">
    <xsl:choose>
      <xsl:when test="@xml:id">
        <xsl:variable name="number">
          <xsl:number level="any"/>
        </xsl:variable>
        <xsl:call-template name="block-element">
          <xsl:with-param name="style">Bibliography</xsl:with-param>
          <xsl:with-param name="bookmark-id">
            <xsl:value-of select="9000+$number"/>
          </xsl:with-param>
          <xsl:with-param name="bookmark-name">
            <xsl:value-of select="@xml:id"/>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="block-element">
          <xsl:with-param name="style">Bibliography</xsl:with-param>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template makeText
Namespace No namespace
Used by
Parameters
QName Namespace
letters No namespace
Import precedence 16
Source
<xsl:template name="makeText">
  <xsl:param name="letters"/>
  <w:r>
    <w:t>
      <xsl:attribute name="xml:space">preserve</xsl:attribute>
      <xsl:value-of select="$letters"/>
    </w:t>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:item/tei:p[not(@rend)]pass0
Documentation

Description

Paragraph in list
Namespace No namespace
Match tei:item/tei:p[not(@rend)]
Mode pass0
Import precedence 16
Source
<xsl:template match="tei:item/tei:p[not(@rend)]" mode="pass0">
  <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass0"/>
  <xsl:if test="following-sibling::tei:p">
    <tei:lb rend="show"/>
  </xsl:if>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:lbpass0
Documentation

Description

remove confusing line breaks
Namespace No namespace
Match tei:lb
Mode pass0
References
Import precedence 16
Source
<xsl:template match="tei:lb" mode="pass0">
  <xsl:choose>
    <xsl:when test="parent::tei:div"/>
    <xsl:when test="parent::tei:body"/>
    <xsl:when test="parent::tei:back"/>
    <xsl:when test="parent::tei:front"/>
    <xsl:when test="not(tei:isInline(..)) and (tei:isLast(.) or tei:isFirst(.))"/>
    <xsl:otherwise>
      <xsl:copy-of select="."/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:pbpass0
Documentation

Description

Page break
Namespace No namespace
Match tei:pb
Mode pass0
References
Function
Parameter
Import precedence 16
Source
<xsl:template match="tei:pb" mode="pass0">
  <xsl:choose>
    <xsl:when test="tei:match(@rend,'none')"/>
    <xsl:when test="$pagebreakStyle='none'"/>
    <xsl:when test="$pagebreakStyle='visible'">
      <note place="margin" xmlns="http://www.tei-c.org/ns/1.0">
        <xsl:text>p. </xsl:text>
        <xsl:value-of select="@n"/>
      </note>
    </xsl:when>
    <xsl:when test="$pagebreakStyle='active'">
      <xsl:copy-of select="."/>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:pb
Namespace No namespace
Match tei:pb
Mode #default
Import precedence 16
Source
<xsl:template match="tei:pb">
  <w:r>
    <w:br w:type="page"/>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:att|tei:hi[tei:match(@rend,'att')]
Namespace No namespace
Match tei:att|tei:hi[tei:match(@rend,'att')]
Mode #default
References
Function
Template
Import precedence 16
Source
<xsl:template match="tei:att|tei:hi[tei:match(@rend,'att')]">
  <xsl:call-template name="makeInline">
    <xsl:with-param name="before">@</xsl:with-param>
    <xsl:with-param name="style">italic</xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:signed
Documentation

Description

A signature block
Namespace No namespace
Match tei:signed
Mode #default
References
Template
Supersedes
Template
Import precedence 16
Source
<xsl:template match="tei:signed">
  <xsl:call-template name="block-element">
    <xsl:with-param name="style">teisigned</xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:title[tei:ref]|tei:hi[tei:ref]
Documentation

Description

If you meet an inline element with a link inside it, pass by on the other side
Namespace No namespace
Match tei:title[tei:ref]|tei:hi[tei:ref]
Mode #default
Import precedence 16
Priority -1
Source
<xsl:template match="tei:title[tei:ref]|tei:hi[tei:ref]" priority="-1">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template makeSpan
Namespace No namespace
Used by
Import precedence 16
Source
<xsl:template name="makeSpan">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template makeExternalLink
Namespace No namespace
Used by
Supersedes
Parameters
Import precedence 16
Source
Stylesheet location ../../../docx/to/teitodocx.xsl
Template marginalNote
Documentation

Description

Marginal notes map to corresponding Word style, albeit named slightly differently
Namespace No namespace
Used by
Template
References
Template
Supersedes
Template
Import precedence 16
Source
<xsl:template name="marginalNote">
  <xsl:call-template name="block-element">
    <xsl:with-param name="style">
      <xsl:value-of select="if (@place='margin') then 'marginOuter'          else if (starts-with(@place,'margin-'))          then concat('margin',upper-case(substring(@place,8,1)),substring(@place,9))          else @place"/>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template @*|comment()|processing-instruction()|text()pass0
Documentation

Description

Templates copying existing markup
Namespace No namespace
Match @*|comment()|processing-instruction()|text()
Mode pass0
Import precedence 16
Source
<xsl:template match="@*|comment()|processing-instruction()|text()" mode="pass0">
  <xsl:copy-of select="."/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template *pass0
Namespace No namespace
Match *
Mode pass0
Import precedence 16
Source
<xsl:template match="*" mode="pass0">
  <xsl:copy>
    <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass0"/>
  </xsl:copy>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template makeSection
Documentation

Description

Generic template from msDescription for high-level section
Namespace No namespace
Used by
References
Template
Parameters
QName Namespace
heading No namespace
implicitBlock No namespace
level No namespace
Import precedence 16
Source
<xsl:template name="makeSection">
  <xsl:param name="level"/>
  <xsl:param name="implicitBlock"/>
  <xsl:param name="heading"/>
  <w:p>
    <w:pPr>
      <w:pStyle w:val="tei{local-name()}"/>
    </w:pPr>
    <w:r>
      <w:t>
        <xsl:value-of select="$heading"/>
      </w:t>
    </w:r>
  </w:p>
  <xsl:call-template name="block-element"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template makeInline
Documentation

Description

Generic template for inline objects
Namespace No namespace
Used by
References
Parameter
Parameters
QName Namespace
after No namespace
before No namespace
style No namespace
Import precedence 16
Source
<xsl:template name="makeInline">
  <xsl:param name="before"/>
  <xsl:param name="after"/>
  <xsl:param name="style"/>
  <w:r>
    <w:rPr>
      <w:rStyle>
        <xsl:attribute name="w:val">
          <xsl:choose>
            <xsl:when test="$style='italic'"/>
            <xsl:when test="$style='bold'"/>
            <xsl:when test="not($style)">
              <xsl:text>tei</xsl:text>
              <xsl:value-of select="local-name()"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:text>tei</xsl:text>
              <xsl:value-of select="$style"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:attribute>
      </w:rStyle>
      <xsl:choose>
        <xsl:when test="$style='italic'">
          <w:i/>
        </xsl:when>
        <xsl:when test="$style='bold'">
          <w:b/>
        </xsl:when>
      </xsl:choose>
      <xsl:if test="$renderAddDel='true' and ancestor-or-self::tei:del">
        <w:strike/>
      </xsl:if>
      <xsl:if test="$style='sup'">
        <w:vertAlign w:val="superscript"/>
      </xsl:if>
      <xsl:if test="$style='sub'">
        <w:vertAlign w:val="subscript"/>
      </xsl:if>
      <xsl:if test="ancestor-or-self::*[@xml:lang]">
        <w:lang w:val="{ancestor-or-self::*[@xml:lang][1]/@xml:lang}"/>
      </xsl:if>
    </w:rPr>
    <w:t>
      <xsl:attribute name="xml:space">preserve</xsl:attribute>
      <xsl:value-of select="$before"/>
      <xsl:value-of select="."/>
      <xsl:value-of select="$after"/>
    </w:t>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template makeBlock
Documentation

Description

Generic template for mid-level block
Namespace No namespace
Used by
References
Template
Parameters
QName Namespace
style No namespace
Import precedence 16
Source
<xsl:template name="makeBlock">
  <xsl:param name="style"/>
  <xsl:call-template name="block-element">
    <xsl:with-param name="style">
      <xsl:value-of select="if ($style='docAuthor') then 'Author'          else if ($style='docTitle') then 'Title'          else if ($style='titlePart') then 'Title'          else $style"/>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template makeWithLabel
Documentation

Description

Generic template for labelled object
Namespace No namespace
Used by
Parameters
QName Namespace
before No namespace
Import precedence 16
Source
<xsl:template name="makeWithLabel">
  <xsl:param name="before"/>
  <w:r>
    <w:rPr>
      <w:i/>
    </w:rPr>
    <w:t>
      <xsl:attribute name="xml:space">preserve</xsl:attribute>
      <xsl:value-of select="$before"/>
      <xsl:text>: </xsl:text>
    </w:t>
  </w:r>
  <w:r>
    <w:rPr>
      <w:rStyle w:val="tei{local-name()}"/>
    </w:rPr>
    <w:t>
      <xsl:value-of select="."/>
    </w:t>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template @*|comment()|processing-instruction()|text()pass2
Documentation

Description

Fallback template copying existing attributes etc in final stage cleanup
Namespace No namespace
Match @*|comment()|processing-instruction()|text()
Mode pass2
Import precedence 16
Source
<xsl:template match="@*|comment()|processing-instruction()|text()" mode="pass2">
  <xsl:copy-of select="."/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template *pass2
Documentation

Description

Fallback template copying existing elements in final stage cleanup
Namespace No namespace
Match *
Mode pass2
Import precedence 16
Source
<xsl:template match="*" mode="pass2">
  <xsl:copy>
    <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
  </xsl:copy>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template w:footnote/w:p[position()>1]/w:r[w:footnoteRef]pass2
Documentation

Description

Only the first paragraph in a footnote has the footnote marker
Namespace No namespace
Match w:footnote/w:p[position()>1]/w:r[w:footnoteRef]
Mode pass2
Import precedence 16
Source
<xsl:template match="w:footnote/w:p[position()>1]/w:r[w:footnoteRef]" mode="pass2">
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template w:body/w:r|w:tc/w:rpass2
Documentation

Description

a run as a direct child of body or table cell is not allowed, how did it creep through? Wrap up in a p.
Namespace No namespace
Match w:body/w:r|w:tc/w:r
Mode pass2
Import precedence 16
Source
<xsl:template match="w:body/w:r|w:tc/w:r" mode="pass2">
  <w:p>
    <xsl:copy>
      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
    </xsl:copy>
  </w:p>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template w:p[w:p]pass2
Documentation

Description

A p as a child of a p is not allowed, this should not happen. If it does, group the other siblings in self-contained p elements.
Namespace No namespace
Match w:p[w:p]
Mode pass2
Import precedence 16
Source
<xsl:template match="w:p[w:p]" mode="pass2">
  <xsl:variable name="props" select="w:pPr"/>
  <xsl:for-each-group select="*" group-adjacent="local-name()">
    <xsl:choose>
      <xsl:when test="current-grouping-key()='p'">
        <xsl:copy-of select="current-group()"/>
      </xsl:when>
      <xsl:when test="current-grouping-key()='pPr'"/>
      <xsl:otherwise>
        <w:p>
          <xsl:copy-of select="$props"/>
          <xsl:copy-of select="current-group()"/>
        </w:p>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:for-each-group>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template w:p[w:tbl]pass2
Documentation

Description

A tbl as a child of a p is not allowed, this should not happen. If it does, group the other siblings in self-contained p elements.
Namespace No namespace
Match w:p[w:tbl]
Mode pass2
Import precedence 16
Source
<xsl:template match="w:p[w:tbl]" mode="pass2">
  <xsl:variable name="props" select="w:pPr"/>
  <xsl:for-each-group select="*" group-adjacent="local-name()">
    <xsl:choose>
      <xsl:when test="current-grouping-key()='p'">
        <xsl:copy-of select="current-group()"/>
      </xsl:when>
      <xsl:when test="current-grouping-key()='tbl'">
        <xsl:copy-of select="current-group()"/>
      </xsl:when>
      <xsl:when test="current-grouping-key()='pPr'"/>
      <xsl:otherwise>
        <w:p>
          <xsl:copy-of select="$props"/>
          <xsl:copy-of select="current-group()"/>
        </w:p>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:for-each-group>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template generateEndLink
Namespace No namespace
Used by
Parameters
Import precedence 16
Source
Stylesheet location ../../../docx/to/teitodocx.xsl
Template displayNote
Namespace No namespace
Used by
Template
References
Template
Supersedes
Template
Import precedence 16
Source
<xsl:template name="displayNote">
  <xsl:call-template name="block-element">
    <xsl:with-param name="style">teiquote</xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:editionStmt
Namespace No namespace
Match tei:editionStmt
Mode #default
Import precedence 16
Source
<xsl:template match="tei:editionStmt">
  <w:r>
    <w:t>
      <xsl:value-of select="tei:edition"/> Edition</w:t>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:listPerson
Documentation

Description

 fake listPerson into an unordered list 
Namespace No namespace
Match tei:listPerson
Mode #default
Import precedence 16
Source
<xsl:template match="tei:listPerson">
  <xsl:variable name="mylist">
    <tei:list type="unordered">
      <xsl:apply-templates/>
    </tei:list>
  </xsl:variable>
  <xsl:apply-templates select="$mylist"/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:person
Namespace No namespace
Match tei:person
Mode #default
Import precedence 16
Source
<xsl:template match="tei:person">
  <tei:item>
    <xsl:copy-of select="*|text()"/>
  </tei:item>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:affiliation
Namespace No namespace
Match tei:affiliation
Mode #default
Import precedence 16
Source
<xsl:template match="tei:affiliation">
  <w:r>
    <w:br/>
  </w:r>
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:date[ancestor::tei:teiHeader]
Documentation

Description

 Dates 
Namespace No namespace
Match tei:date[ancestor::tei:teiHeader]
Mode #default
Import precedence 16
Source
<xsl:template match="tei:date[ancestor::tei:teiHeader]">
  <w:r>
    <w:rPr>
      <w:rStyle w:val="date"/>
    </w:rPr>
    <w:t>
      <xsl:value-of select="."/>
    </w:t>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:formula
Documentation

Description

 formulas 
Namespace No namespace
Match tei:formula
Mode #default
References
Template
Import precedence 16
Source
<xsl:template match="tei:formula">
  <w:p>
    <w:pPr>
      <w:pStyle w:val="Formula"/>
    </w:pPr>
    <xsl:call-template name="block-element">
      <xsl:with-param name="nop">true</xsl:with-param>
    </xsl:call-template>
    <xsl:if test="@n">
      <w:r>
        <w:tab/>
      </w:r>
      <w:r>
        <w:rPr>
          <w:rStyle w:val="FormulaReference"/>
        </w:rPr>
        <w:t xml:space="preserve"><xsl:value-of select="@n"/>
        </w:t>
      </w:r>
    </xsl:if>
  </w:p>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template created-by
Documentation

Description

 who created this document 
Namespace No namespace
Supersedes
Template
Import precedence 16
Source
<xsl:template name="created-by">
  <xsl:text>TEI XSL</xsl:text>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template tei:fw/tei:p
Namespace No namespace
Match tei:fw/tei:p
Mode #default
Import precedence 16
Source
<xsl:template match="tei:fw/tei:p">
  <w:p>
    <w:pPr>
      <w:pStyle>
        <xsl:attribute name="w:val" select="@rend"/>
      </w:pStyle>
    </w:pPr>
    <xsl:apply-templates/>
  </w:p>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Template horizontalRule
Namespace No namespace
Used by
Template
Import precedence 16
Source
<xsl:template name="horizontalRule">
  <w:p>
    <w:pPr>
      <w:pBdr>
        <w:top w:color="auto" w:space="1" w:val="single" w:sz="4"/>
      </w:pBdr>
    </w:pPr>
  </w:p>
</xsl:template>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter createanttask
Namespace No namespace
Source
<xsl:param name="createanttask">false</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter useHeaderFrontMatter
Namespace No namespace
Used by
Supersedes
Source
<xsl:param name="useHeaderFrontMatter">false</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter useFixedDate
Namespace No namespace
Used by
Supersedes
Parameter
Source
<xsl:param name="useFixedDate">false</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter addColour
Documentation

Description

        A4 is 210mm x 297mm; leaving 1in margin (25mm),
        gives 160 x 247 approx useable area. For figures,
	Microsoft use English metrical units (emu), in which
        1mm = 3600 units. So page size is 57600 * 889200
        Divide by 100 to avoid overflow in calculations.

        For other measurements in Word, see useful discussion at
	http://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/
    
Namespace No namespace
Overriding
Parameter
Source
<xsl:param name="addColour">red</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter alignFigures
Namespace No namespace
Used by
Template
Source
<xsl:param name="alignFigures">center</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter bulletEight
Namespace No namespace
Used by
Source
<xsl:param name="bulletEight"></xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter bulletFive
Namespace No namespace
Used by
Source
<xsl:param name="bulletFive"></xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter bulletFour
Namespace No namespace
Used by
Source
<xsl:param name="bulletFour">+</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter bulletOne
Namespace No namespace
Overriding
Parameter
Source
<xsl:param name="bulletOne"></xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter bulletSeven
Namespace No namespace
Used by
Source
<xsl:param name="bulletSeven"></xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter bulletSix
Namespace No namespace
Used by
Source
<xsl:param name="bulletSix"></xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter bulletThree
Namespace No namespace
Used by
Source
<xsl:param name="bulletThree">*</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter bulletTwo
Namespace No namespace
Overriding
Parameter
Source
<xsl:param name="bulletTwo"></xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter debug
Namespace No namespace
Used by
Source
<xsl:param name="debug">false</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter typewriterFont
Namespace No namespace
Used by
Source
<xsl:param name="typewriterFont">DejaVu Sans Mono</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter defaultHeaderFooterFile
Namespace No namespace
Overriding
Source
<xsl:param name="defaultHeaderFooterFile">templates/default.xml</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter headInXref
Namespace No namespace
Used by
Supersedes
Parameter
Source
<xsl:param name="headInXref">false</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter inputDir
Namespace No namespace
Source
<xsl:param name="inputDir">.</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter inputFile
Namespace No namespace
Used by
Template
Source
<xsl:param name="inputFile"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter pageHeight
Namespace No namespace
Used by
Source
<xsl:param name="pageHeight">890</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter pageWidth
Namespace No namespace
Used by
Source
<xsl:param name="pageWidth">576</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter postQuote
Namespace No namespace
Used by
Supersedes
Parameter
Source
<xsl:param name="postQuote"></xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter preQuote
Namespace No namespace
Used by
Supersedes
Parameter
Source
<xsl:param name="preQuote"></xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter renderAddDel
Namespace No namespace
Overriding
Parameter
Source
<xsl:param name="renderAddDel">true</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter shadowGraphics
Namespace No namespace
Used by
Source
<xsl:param name="shadowGraphics">false</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter word-directory
Namespace No namespace
Used by
Variable
Source
<xsl:param name="word-directory">..</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter tableWidthPercentage
Namespace No namespace
Used by
Templates
Source
<xsl:param name="tableWidthPercentage"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter glossListSeparator
Namespace No namespace
Used by
Source
<xsl:param name="glossListSeparator">tab</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter footnoteNumbering
Namespace No namespace
Overriding
Parameter
Source
<xsl:param name="footnoteNumbering">decimal</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Parameter isofreestanding
Namespace No namespace
Used by
Template
Source
<xsl:param name="isofreestanding">true</xsl:param>
Stylesheet location ../../../docx/to/teitodocx.xsl
Variable align
Namespace No namespace
Source
<xsl:variable name="align">right</xsl:variable>
Stylesheet location ../../../docx/to/teitodocx.xsl
Variable wordDirectory
Namespace No namespace
Used by
References
Parameter
Supersedes
Parameter
Source
<xsl:variable name="wordDirectory">
  <xsl:value-of select="translate($word-directory,'\\','/')"/>
</xsl:variable>
Stylesheet location ../../../docx/to/teitodocx.xsl
Variable styleDoc
Namespace No namespace
Used by
Templates
References
Variable
Source
<xsl:variable name="styleDoc">
  <xsl:value-of select="concat($wordDirectory, '/word/styles.xml')"/>
</xsl:variable>
Stylesheet location ../../../docx/to/teitodocx.xsl
Variable numberDoc
Namespace No namespace
Used by
References
Variable
Source
<xsl:variable name="numberDoc">
  <xsl:value-of select="concat($wordDirectory, '/word/numbering.xml')"/>
</xsl:variable>
Stylesheet location ../../../docx/to/teitodocx.xsl
Variable relDoc
Namespace No namespace
Used by
References
Variable
Source
<xsl:variable name="relDoc">
  <xsl:value-of select="concat($wordDirectory, '/word/_rels/document.xml.rels')"/>
</xsl:variable>
Stylesheet location ../../../docx/to/teitodocx.xsl
Variable relDocFoot
Namespace No namespace
Used by
References
Variable
Source
<xsl:variable name="relDocFoot">
  <xsl:value-of select="concat($wordDirectory, '/word/_rels/footnotes.xml.rels')"/>
</xsl:variable>
Stylesheet location ../../../docx/to/teitodocx.xsl
Variable relDocEnd
Namespace No namespace
Used by
References
Variable
Source
<xsl:variable name="relDocEnd">
  <xsl:value-of select="concat($wordDirectory, '/word/_rels/endnotes.xml.rels')"/>
</xsl:variable>
Stylesheet location ../../../docx/to/teitodocx.xsl
Variable coreFile
Namespace No namespace
Used by
References
Variable
Source
<xsl:variable name="coreFile">
  <xsl:value-of select="concat($wordDirectory, '/docProps/core.xml')"/>
</xsl:variable>
Stylesheet location ../../../docx/to/teitodocx.xsl
Variable appFile
Namespace No namespace
Used by
References
Variable
Source
<xsl:variable name="appFile">
  <xsl:value-of select="concat($wordDirectory, '/docProps/app.xml')"/>
</xsl:variable>
Stylesheet location ../../../docx/to/teitodocx.xsl
Output (default)
Namespace No namespace
Output properties
method encoding
xml
Source
<xsl:output method="xml" version="1.0" encoding="UTF-8"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Key FOOTERS
Namespace No namespace
Match tei:fw[@type='footer']
Use @xml:id
Used by
Template
Source
<xsl:key name="FOOTERS" match="tei:fw[@type='footer']" use="@xml:id"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Key HEADERS
Namespace No namespace
Match tei:fw[@type='header']
Use @xml:id
Used by
Template
Source
<xsl:key name="HEADERS" match="tei:fw[@type='header']" use="@xml:id"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Key ALLFOOTERS
Namespace No namespace
Match tei:fw[@type='footer']
Use 1
Used by
Source
<xsl:key name="ALLFOOTERS" match="tei:fw[@type='footer']" use="1"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Key ALLHEADERS
Namespace No namespace
Match tei:fw[@type='header']
Use 1
Used by
Source
<xsl:key name="ALLHEADERS" match="tei:fw[@type='header']" use="1"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Key ENDNOTES
Namespace No namespace
Match tei:note[tei:isEndNote(.)]
Use 1
Used by
References
Source
<xsl:key name="ENDNOTES" match="tei:note[tei:isEndNote(.)]" use="1"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Key FOOTNOTES
Namespace No namespace
Match tei:note[tei:isFootNote(.) ]
Use 1
Used by
References
Source
<xsl:key name="FOOTNOTES" match="tei:note[tei:isFootNote(.) ]" use="1"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Key OL
Namespace No namespace
Match tei:list[tei:isOrderedList(.)]
Use 1
Used by
References
Source
<xsl:key name="OL" match="tei:list[tei:isOrderedList(.)]" use="1"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Key BLIP
Namespace No namespace
Match a:blip
Use 1
Used by
Source
<xsl:key name="BLIP" match="a:blip" use="1"/>
Stylesheet location ../../../docx/to/teitodocx.xsl
Key Styles
Namespace No namespace
Match w:style/w:name
Use @w:val
Used by
Template
Source
<xsl:key name="Styles" match="w:style/w:name" use="@w:val"/>
Stylesheet location ../../../docx/to/teitodocx.xsl