Showing:

Documentation
Parameters
Used by
References
Supersedes
Imported modules
Included modules
Source
Main stylesheet to.xsl
Documentation

Description

TEI stylesheet for making Word docx files from TEI XML (see tei-docx.xsl)

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

Author: See AUTHORS

Id: $Id: to.xsl 7754 2010-06-23 22:41:20Z rahtz $

Copyright: 2008, TEI Consortium

Imported modules
Included modules
Stylesheet version 2.0
Template tei:foreignget-style
Documentation

Description

 Styles 
Namespace No namespace
Match tei:foreign
Mode get-style
Import precedence 14
Source
<xsl:template match="tei:foreign" mode="get-style">teiforeign</xsl:template>
Stylesheet location to.xsl
Template tei:citget-style
Namespace No namespace
Match tei:cit
Mode get-style
Import precedence 14
Source
<xsl:template match="tei:cit" mode="get-style">Quote</xsl:template>
Stylesheet location to.xsl
Template tei:dateget-style
Namespace No namespace
Match tei:date
Mode get-style
Import precedence 14
Source
<xsl:template match="tei:date" mode="get-style">teidate</xsl:template>
Stylesheet location to.xsl
Template tei:formulaget-style
Namespace No namespace
Match tei:formula
Mode get-style
Import precedence 14
Source
<xsl:template match="tei:formula" mode="get-style">Formula</xsl:template>
Stylesheet location to.xsl
Template tei:list[@type='termlist' and ancestor-or-self::*/@type='termsAndDefinitions']/tei:item/tei:abbrget-style
Namespace No namespace
Match tei:list[@type='termlist' and ancestor-or-self::*/@type='termsAndDefinitions']/tei:item/tei:abbr
Mode get-style
Import precedence 14
Source
<xsl:template match="tei:list[@type='termlist' and ancestor-or-self::*/@type='termsAndDefinitions']/tei:item/tei:abbr" mode="get-style">ExtRef</xsl:template>
Stylesheet location to.xsl
Template tei:mentionedget-style
Namespace No namespace
Match tei:mentioned
Mode get-style
Import precedence 14
Source
<xsl:template match="tei:mentioned" mode="get-style">teimentioned</xsl:template>
Stylesheet location to.xsl
Template tei:orgNameget-style
Namespace No namespace
Match tei:orgName
Mode get-style
Import precedence 14
Source
<xsl:template match="tei:orgName" mode="get-style">orgName</xsl:template>
Stylesheet location to.xsl
Template tei:p[@rend]get-style
Namespace No namespace
Match tei:p[@rend]
Mode get-style
References
Template getStyleName
Import precedence 14
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 to.xsl
Template tei:quoteget-style
Namespace No namespace
Match tei:quote
Mode get-style
Import precedence 14
Source
<xsl:template match="tei:quote" mode="get-style">Quote</xsl:template>
Stylesheet location to.xsl
Template tei:refget-style
Namespace No namespace
Match tei:ref
Mode get-style
Import precedence 14
Source
<xsl:template match="tei:ref" mode="get-style">ExtXref</xsl:template>
Stylesheet location to.xsl
Template tei:c[@iso:font and @n]
Documentation

Description

 
        Inline Templates:
        Here we can overwrite how inline elements are rendered
    
Namespace No namespace
Match tei:c[@iso:font and @n]
Mode #default
Import precedence 14
Source
<xsl:template match="tei:c[@iso:font and @n]">
  <w:r>
    <w:sym w:font="{@iso:font}" w:char="{@n}"/>
  </w:r>
</xsl:template>
Stylesheet location to.xsl
Template tei:editionStmt
Namespace No namespace
Match tei:editionStmt
Mode #default
Import precedence 14
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 to.xsl
Template tei:label[following-sibling::tei:*[1]/self::tei:item]
Namespace No namespace
Match tei:label[following-sibling::tei:*[1]/self::tei:item]
Mode #default
Supersedes
Parameters
QName Namespace
nop No namespace
Import precedence 14
Source
<xsl:template match="tei:label[following-sibling::tei:*[1]/self::tei:item]">
  <xsl:param name="nop"/>
  <xsl:variable name="pair">
    <tei:list>
      <tei:glossListEntry count="{count(ancestor::tei:list)}">
        <tei:hi rend="bold">
          <xsl:apply-templates mode="iden"/>
        </tei:hi>
        <tei:lb/>
        <xsl:for-each select="following-sibling::tei:item[1]">
          <xsl:apply-templates mode="iden"/>
        </xsl:for-each>
      </tei:glossListEntry>
    </tei:list>
  </xsl:variable>
  <xsl:apply-templates select="$pair/tei:list/tei:glossListEntry"/>
</xsl:template>
Stylesheet location to.xsl
Template tei:glossListEntry
Namespace No namespace
Match tei:glossListEntry
Mode #default
References
Template block-element
Import precedence 14
Source
<xsl:template match="tei:glossListEntry">
  <xsl:call-template name="block-element">
    <xsl:with-param name="style" select="dl"/>
    <xsl:with-param name="pPr">
      <w:pPr>
        <w:pStyle w:val="dl"/>
        <w:ind w:left="360" w:hanging="360"/>
      </w:pPr>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location to.xsl
Template tei:pb
Namespace No namespace
Match tei:pb
Mode #default
Import precedence 14
Source
<xsl:template match="tei:pb">
  <w:r>
    <w:br w:type="page"/>
  </w:r>
</xsl:template>
Stylesheet location to.xsl
Template tei:seg[not(@*) and normalize-space(.)='']
Namespace No namespace
Match tei:seg[not(@*) and normalize-space(.)='']
Mode #default
Import precedence 14
Source
<xsl:template match="tei:seg[not(@*) and normalize-space(.)='']">
  <w:r>
    <w:t>
      <xsl:attribute name="xml:space">preserve</xsl:attribute>
      <xsl:text> </xsl:text>
    </w:t>
  </w:r>
</xsl:template>
Stylesheet location to.xsl
Template tei:date
Documentation

Description

 
        Block Templates:
        Here we can overwrite how block elements are rendered
    
 Dates 
Namespace No namespace
Match tei:date
Mode #default
Supersedes
Template tei:date
Import precedence 14
Source
<xsl:template match="tei:date">
  <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 to.xsl
Template tei:formula
Documentation

Description

 formulas 
Namespace No namespace
Match tei:formula
Mode #default
References
Template block-element
Import precedence 14
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 to.xsl
Template tei:listBibl
Documentation

Description

 List Bibl 
Namespace No namespace
Match tei:listBibl
Mode #default
References
Import precedence 14
Source
<xsl:template match="tei:listBibl">
  <xsl:choose>
    <xsl:when test="ancestor-or-self::*[@type='normativeReferences']">
      <xsl:for-each select="tei:bibl">
        <xsl:call-template name="block-element">
          <xsl:with-param name="pPr">
            <w:pPr>
              <w:pStyle>
                <xsl:attribute name="w:val">
                  <xsl:call-template name="getStyleName">
                    <xsl:with-param name="in">
                      <xsl:text>RefNorm</xsl:text>
                    </xsl:with-param>
                  </xsl:call-template>
                </xsl:attribute>
              </w:pStyle>
            </w:pPr>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:for-each>
    </xsl:when>
    <xsl:otherwise>
      <xsl:for-each select="tei:bibl">
        <xsl:call-template name="block-element">
          <xsl:with-param name="style">Bibliography</xsl:with-param>
        </xsl:call-template>
      </xsl:for-each>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location to.xsl
Template tei:note[@place]
Documentation

Description

 
        Special Notes (Footnotes) .. 
        @TODO: Ideally this should go into the general template, but for some
        reason xsl always calls the less specific tei:note template in here. 
    
Namespace No namespace
Match tei:note[@place]
Mode #default
References
Import precedence 14
Source
<xsl:template match="tei:note[@place]">
  <xsl:choose>
    <xsl:when test="@place='foot'  or @place='bottom' or @place='tablefoot' ">
      <xsl:call-template name="create-footnote"/>
    </xsl:when>
    <xsl:when test="@place='end'">
      <xsl:call-template name="create-endnote"/>
    </xsl:when>
    <xsl:when test="@place='comment'">
      <xsl:call-template name="create-comment"/>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location to.xsl
Template tei:front/tei:div/tei:p
Documentation

Description

 Paragraphs in the front matter 
Namespace No namespace
Match tei:front/tei:div/tei:p
Mode #default
References
Template block-element
Variables lowercase; uppercase
Import precedence 14
Source
<xsl:template match="tei:front/tei:div/tei:p">
  <xsl:call-template name="block-element">
    <xsl:with-param name="pPr">
      <w:pPr>
        <w:pStyle>
          <xsl:attribute name="w:val">
            <xsl:value-of select="concat(translate(substring(parent::tei:div/@type,1,1),$lowercase,$uppercase),substring(parent::tei:div/@type,2))"/>
          </xsl:attribute>
        </w:pStyle>
      </w:pPr>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location to.xsl
Template created-by
Documentation

Description

 who created this document 
Namespace No namespace
Used by
Supersedes
Template created-by
Import precedence 14
Source
<xsl:template name="created-by">
  <xsl:text>Vesta</xsl:text>
</xsl:template>
Stylesheet location to.xsl
Template tei:listPerson
Documentation

Description

 fake listPerson into an unordered list 
Namespace No namespace
Match tei:listPerson
Mode #default
Import precedence 14
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 to.xsl
Template tei:person
Namespace No namespace
Match tei:person
Mode #default
Import precedence 14
Source
<xsl:template match="tei:person">
  <tei:item>
    <xsl:copy-of select="*|text()"/>
  </tei:item>
</xsl:template>
Stylesheet location to.xsl
Template tei:affiliation
Namespace No namespace
Match tei:affiliation
Mode #default
Import precedence 14
Source
<xsl:template match="tei:affiliation">
  <w:r>
    <w:br/>
  </w:r>
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location to.xsl
Template defineOrderedLists
Namespace No namespace
Used by
Supersedes
Import precedence 14
Source
<xsl:template name="defineOrderedLists">
  <w:abstractNum w:abstractNumId="3">
    <w:multiLevelType w:val="multilevel"/>
    <w:lvl w:ilvl="0">
      <w:start w:val="1"/>
      <w:numFmt w:val="decimal"/>
      <w:pStyle w:val="ListNumber"/>
      <w:lvlText w:val="%1."/>
      <w:lvlJc w:val="left"/>
      <w:pPr>
        <w:ind w:left="360" w:hanging="360"/>
      </w:pPr>
      <w:rPr>
        <w:rFonts w:hint="default"/>
      </w:rPr>
    </w:lvl>
    <w:lvl w:ilvl="1">
      <w:start w:val="1"/>
      <w:numFmt w:val="lowerLetter"/>
      <w:pStyle w:val="ListNumber2"/>
      <w:lvlText w:val="%2)"/>
      <w:lvlJc w:val="left"/>
      <w:pPr>
        <w:ind w:left="720" w:hanging="360"/>
      </w:pPr>
      <w:rPr>
        <w:rFonts w:hint="default"/>
      </w:rPr>
    </w:lvl>
    <w:lvl w:ilvl="2">
      <w:start w:val="1"/>
      <w:numFmt w:val="lowerRoman"/>
      <w:pStyle w:val="ListNumber3"/>
      <w:lvlText w:val="%3)"/>
      <w:lvlJc w:val="left"/>
      <w:pPr>
        <w:ind w:left="1080" w:hanging="360"/>
      </w:pPr>
      <w:rPr>
        <w:rFonts w:hint="default"/>
      </w:rPr>
    </w:lvl>
    <w:lvl w:ilvl="3">
      <w:start w:val="1"/>
      <w:numFmt w:val="upperRoman"/>
      <w:pStyle w:val="ListNumber4"/>
      <w:lvlText w:val="%4)"/>
      <w:lvlJc w:val="left"/>
      <w:pPr>
        <w:ind w:left="1440" w:hanging="360"/>
      </w:pPr>
      <w:rPr>
        <w:rFonts w:hint="default"/>
      </w:rPr>
    </w:lvl>
    <w:lvl w:ilvl="4">
      <w:start w:val="1"/>
      <w:numFmt w:val="lowerLetter"/>
      <w:lvlText w:val="(%5)"/>
      <w:lvlJc w:val="left"/>
      <w:pPr>
        <w:ind w:left="1800" w:hanging="360"/>
      </w:pPr>
      <w:rPr>
        <w:rFonts w:hint="default"/>
      </w:rPr>
    </w:lvl>
    <w:lvl w:ilvl="5">
      <w:start w:val="1"/>
      <w:numFmt w:val="lowerRoman"/>
      <w:lvlText w:val="(%6)"/>
      <w:lvlJc w:val="left"/>
      <w:pPr>
        <w:ind w:left="2160" w:hanging="360"/>
      </w:pPr>
      <w:rPr>
        <w:rFonts w:hint="default"/>
      </w:rPr>
    </w:lvl>
    <w:lvl w:ilvl="6">
      <w:start w:val="1"/>
      <w:numFmt w:val="decimal"/>
      <w:lvlText w:val="%7."/>
      <w:lvlJc w:val="left"/>
      <w:pPr>
        <w:ind w:left="2520" w:hanging="360"/>
      </w:pPr>
      <w:rPr>
        <w:rFonts w:hint="default"/>
      </w:rPr>
    </w:lvl>
    <w:lvl w:ilvl="7">
      <w:start w:val="1"/>
      <w:numFmt w:val="lowerLetter"/>
      <w:lvlText w:val="%8."/>
      <w:lvlJc w:val="left"/>
      <w:pPr>
        <w:ind w:left="2880" w:hanging="360"/>
      </w:pPr>
      <w:rPr>
        <w:rFonts w:hint="default"/>
      </w:rPr>
    </w:lvl>
    <w:lvl w:ilvl="8">
      <w:start w:val="1"/>
      <w:numFmt w:val="lowerRoman"/>
      <w:lvlText w:val="%9."/>
      <w:lvlJc w:val="left"/>
      <w:pPr>
        <w:ind w:left="3240" w:hanging="360"/>
      </w:pPr>
      <w:rPr>
        <w:rFonts w:hint="default"/>
      </w:rPr>
    </w:lvl>
  </w:abstractNum>
</xsl:template>
Stylesheet location to.xsl
Template @*|text()|comment()|processing-instruction()iden
Namespace No namespace
Match @*|text()|comment()|processing-instruction()
Mode iden
Supersedes
Import precedence 14
Source
<xsl:template match="@*|text()|comment()|processing-instruction()" mode="iden">
  <xsl:copy-of select="."/>
</xsl:template>
Stylesheet location to.xsl
Template *iden
Namespace No namespace
Match *
Mode iden
Supersedes
Template *iden
Import precedence 14
Source
<xsl:template match="*" mode="iden">
  <xsl:copy>
    <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="iden"/>
  </xsl:copy>
</xsl:template>
Stylesheet location to.xsl
Parameter bulletOne
Namespace No namespace
Used by
Supersedes
Parameter bulletOne
Source
<xsl:param name="bulletOne"></xsl:param>
Stylesheet location to.xsl
Parameter bulletTwo
Namespace No namespace
Used by
Supersedes
Parameter bulletTwo
Source
<xsl:param name="bulletTwo"></xsl:param>
Stylesheet location to.xsl
Parameter word-directory
Namespace No namespace
Used by
Supersedes
Parameter word-directory
Source
<xsl:param name="word-directory">..</xsl:param>
Stylesheet location to.xsl
Parameter debug
Namespace No namespace
Used by
Supersedes
Parameter debug
Source
<xsl:param name="debug">false</xsl:param>
Stylesheet location to.xsl
Parameter styleDoc
Namespace No namespace
Used by
Template getStyleName
References
Parameter word-directory
Supersedes
Parameter styleDoc
Source
<xsl:param name="styleDoc">
  <xsl:value-of select="concat($word-directory, '/word/styles.xml')"/>
</xsl:param>
Stylesheet location to.xsl