Mode:

Compact lists

Showing:

Documentation
Used by
References
Included from
Source
Stylesheet maths.xsl
Documentation

Description

TEI stylesheet for converting Word docx files to TEI

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

Included from
Stylesheet version 3.0
Template w:p[w:pPr/w:pStyle/@w:val='Formula']paragraph
Documentation

Description

Handles a single paragraph that contains a math object
Namespace No namespace
Match w:p[w:pPr/w:pStyle/@w:val='Formula']
Mode paragraph
References
Import precedence 7
Source
<xsl:template match="w:p[w:pPr/w:pStyle/@w:val='Formula']" mode="paragraph">
  <xsl:call-template name="paragraph-formula"/>
</xsl:template>
Stylesheet location ../../../docx/from/maths.xsl
Template w:p[m:oMathPara]paragraph
Documentation

Description

//TODO: figure out why there is a priority=-1
Namespace No namespace
Match w:p[m:oMathPara]
Mode paragraph
Import precedence 7
Priority -1
Source
<xsl:template match="w:p[m:oMathPara]" mode="paragraph" priority="-1">
  <p>
    <formula>
      <xsl:apply-templates select="m:oMathPara/m:oMath"/>
    </formula>
  </p>
</xsl:template>
Stylesheet location ../../../docx/from/maths.xsl
Template w:p[m:oMath]paragraph
Documentation

Description

//TODO: figure out why there is a priority=-1
Namespace No namespace
Match w:p[m:oMath]
Mode paragraph
Import precedence 7
Priority -1
Source
<xsl:template match="w:p[m:oMath]" mode="paragraph" priority="-1">
  <p>
    <formula>
      <xsl:apply-templates select="m:oMath"/>
    </formula>
  </p>
</xsl:template>
Stylesheet location ../../../docx/from/maths.xsl
Template paragraph-formula
Documentation

Description

named template for w:p[w:pPr/w:pStyle/@w:val='Formula'
Namespace No namespace
Used by
Import precedence 7
Source
<xsl:template name="paragraph-formula">
  <p>
    <formula>
      <xsl:if test="w:r/w:rPr/w:rStyle/@w:val='FormulaReference'">
        <xsl:attribute name="n">
          <xsl:value-of select="w:r[w:rPr/w:rStyle/@w:val='FormulaReference']/w:t"/>
        </xsl:attribute>
      </xsl:if>
      <xsl:apply-templates/>
    </formula>
  </p>
</xsl:template>
Stylesheet location ../../../docx/from/maths.xsl
Template m:oMath
Documentation

Description

Depending on the math mode, omml is either converted to mathML or an identity transformation is started
Namespace No namespace
Match m:oMath
Mode #default
References
Parameter
Import precedence 7
Source
<xsl:template match="m:oMath">
  <xsl:choose>
    <xsl:when test="$mathMethod='omml'">
      <xsl:apply-templates select="." mode="iden"/>
    </xsl:when>
    <xsl:otherwise>
      <mml:math>
        <xsl:apply-templates/>
      </mml:math>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/from/maths.xsl
Template w:object
Documentation

Description

Handles a w:object, possibly by just copying it else giving error

Namespace No namespace
Match w:object
Mode #default
References
Import precedence 7
Source
<xsl:template match="w:object">
  <xsl:choose>
    <xsl:when test="preserveObject='true'">
      <xsl:copy>
        <xsl:apply-templates mode="iden"/>
      </xsl:copy>
    </xsl:when>
    <xsl:otherwise>
      <xsl:sequence select="tei:docxError('unable to handle Word       object, possibly  embedded       spreadsheet or equation')"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../docx/from/maths.xsl
Template v:imagedataiden
Documentation

Description

Guides the identity transformation of imagedata in math
Namespace No namespace
Match v:imagedata
Mode iden
References
Variable
Import precedence 7
Source
<xsl:template match="v:imagedata" mode="iden">
  <xsl:variable name="rid" select="@r:id"/>
  <xsl:variable name="file">
    <xsl:value-of select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target"/>
  </xsl:variable>
  <v:imagedata r:id="{$file}"/>
</xsl:template>
Stylesheet location ../../../docx/from/maths.xsl
Template o:OLEObjectiden
Documentation

Description

Guides the identity transformation of ole in maths
Namespace No namespace
Match o:OLEObject
Mode iden
References
Variable
Import precedence 7
Source
<xsl:template match="o:OLEObject" mode="iden">
  <o:OLEObject>
    <xsl:copy-of select="@*"/>
    <xsl:variable name="rid" select="@r:id"/>
    <xsl:variable name="file">
      <xsl:value-of select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target"/>
    </xsl:variable>
    <xsl:attribute name="r:id">
      <xsl:value-of select="$file"/>
    </xsl:attribute>
  </o:OLEObject>
</xsl:template>
Stylesheet location ../../../docx/from/maths.xsl