Showing:

Documentation
References
Imported modules
Included from
Source
Stylesheet maths.xsl
Documentation

Description

TEI stylesheet for making Word docx files from TEI XML

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: maths.xsl 7952 2010-08-12 21:14:51Z rahtz $

Copyright: 2008, TEI Consortium

Imported modules
Included from
Stylesheet version 2.0
Template m:oMath
Namespace No namespace
Match m:oMath
Mode #default
Import precedence 12
Source
<xsl:template match="m:oMath">
  <xsl:apply-templates select="." mode="iden"/>
</xsl:template>
Stylesheet location ../../../docx/to/maths/maths.xsl
Template mml:math
Namespace No namespace
Match mml:math
Mode #default
Import precedence 12
Source
<xsl:template match="mml:math">
  <oMath xmlns="http://schemas.openxmlformats.org/officeDocument/2006/math">
    <xsl:apply-templates mode="mml"/>
  </oMath>
</xsl:template>
Stylesheet location ../../../docx/to/maths/maths.xsl
Template w:object
Documentation

Description

Process Word objects
Namespace No namespace
Match w:object
Mode #default
References
Template applyRend
Import precedence 12
Source
<xsl:template match="w:object">
  <xsl:variable name="renderingProperties">
    <xsl:for-each select="..">
      <xsl:call-template name="applyRend"/>
    </xsl:for-each>
  </xsl:variable>
  <w:r>
    <xsl:if test="$renderingProperties/*">
      <w:rPr>
        <xsl:copy-of select="$renderingProperties"/>
      </w:rPr>
    </xsl:if>
    <xsl:copy>
      <xsl:apply-templates mode="iden"/>
    </xsl:copy>
  </w:r>
</xsl:template>
Stylesheet location ../../../docx/to/maths/maths.xsl
Template v:imagedataiden
Documentation

Description

Image data
Namespace No namespace
Match v:imagedata
Mode iden
References
Import precedence 12
Source
<xsl:template match="v:imagedata" mode="iden">
  <xsl:variable name="current" select="@r:id"/>
  <xsl:copy>
    <!-- override r:id -->
    <xsl:attribute name="r:id">
      <xsl:choose>
        <xsl:when test="$isofreestanding='true'">
          <xsl:variable name="me" select="generate-id()"/>
          <xsl:for-each select="key('IMAGEDATA',1)">
            <xsl:if test="generate-id()=$me">
              <xsl:value-of select="concat('rId', string(1000 + position()))"/>
            </xsl:if>
          </xsl:for-each>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="document(concat($word-directory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Target=$current]/@Id"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:attribute>
  </xsl:copy>
</xsl:template>
Stylesheet location ../../../docx/to/maths/maths.xsl
Template o:OLEObjectiden
Documentation

Description

OLE objects
Namespace No namespace
Match o:OLEObject
Mode iden
References
Import precedence 12
Source
<xsl:template match="o:OLEObject" mode="iden">
  <xsl:variable name="current" select="@r:id"/>
  <xsl:copy>
    <!-- copy all attributes -->
    <xsl:copy-of select="@*"/>
    <!-- set rId -->
    <xsl:attribute name="r:id">
      <xsl:choose>
        <xsl:when test="$isofreestanding='true'">
          <xsl:variable name="me" select="generate-id()"/>
          <xsl:for-each select="key('OLEOBJECTS',1)">
            <xsl:if test="generate-id()=$me">
              <xsl:value-of select="concat('rId', string(2000 + position()))"/>
            </xsl:if>
          </xsl:for-each>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="document(concat($word-directory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Target=$current]/@Id"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:attribute>
  </xsl:copy>
</xsl:template>
Stylesheet location ../../../docx/to/maths/maths.xsl