Showing:

Documentation
Used by
References
Overriding
Imported modules
Included from
Source
Stylesheet maths.xsl
Documentation

Description

TEI stylesheet for converting Word docx files to TEI

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

Author: See AUTHORS

Id: $Id: from.xsl 6832 2009-10-12 22:42:59Z rahtz $

Copyright: 2008, TEI Consortium

Imported modules
Included from
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 12
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/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 12
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/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 12
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/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 12
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/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 mathMethod
Import precedence 12
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/maths.xsl
Template w:object
Documentation

Description

Handles a w:object by copying it

Namespace No namespace
Match w:object
Mode #default
Overriding
Template w:object
Import precedence 12
Source
<xsl:template match="w:object">
  <xsl:copy-of select="."/>
</xsl:template>
Stylesheet location ../../../docx/from/maths/maths.xsl
Template v:imagedataiden
Documentation

Description

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

Description

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