Showing:

Documentation
Used by
References
Included from
Source
Stylesheet relationships.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: relationships.xsl 7952 2010-08-12 21:14:51Z rahtz $

Copyright: 2008, TEI Consortium

Included from
Stylesheet version 2.0
Template write-docxfile-main-relationships
Documentation

Description

Write _rels/.rels
Namespace No namespace
Used by
Template write-docxfiles
References
Parameters debug; word-directory
Import precedence 12
Source
<xsl:template name="write-docxfile-main-relationships">
  <xsl:if test="$debug='true'">
    <xsl:message>Writing out
      <xsl:value-of select="concat($word-directory,'/_rels/.rels')"/>
    </xsl:message>
  </xsl:if>
  <xsl:result-document href="{concat($word-directory,'/_rels/.rels')}" standalone="yes">
    <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
      <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
      <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
      <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
      <Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties" Target="docProps/custom.xml"/>
    </Relationships>
  </xsl:result-document>
</xsl:template>
Stylesheet location ../../../docx/to/docxfiles/relationships.xsl
Template write-docxfile-relationships
Documentation

Description

Write word/_rels/document.xml.rels
Namespace No namespace
Used by
Template write-docxfiles
References
Import precedence 12
Source
<xsl:template name="write-docxfile-relationships">
  <xsl:if test="$debug='true'">
    <xsl:message>Writing out
      <xsl:value-of select="concat($word-directory,'/word/_rels/document.xml.rels')"/>
    </xsl:message>
  </xsl:if>
  <xsl:result-document href="{concat($word-directory,'/word/_rels/document.xml.rels')}" standalone="yes">
    <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
      <!-- Mandatory Relationships -->
      <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering" Target="numbering.xml"/>
      <Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
      <Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="settings.xml"/>
      <Relationship Id="rId7" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes" Target="footnotes.xml"/>
      <Relationship Id="rId8" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes" Target="endnotes.xml"/>
      <Relationship Id="rId9" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" Target="comments.xml"/>
      <!-- odd stuff -->
      <Relationship Id="rId18" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" Target="fontTable.xml"/>
      <!-- Any raw blips left in? -->
      <xsl:for-each select="key('BLIP',1)">
        <xsl:choose>
          <xsl:when test="@r:embed">
            <Relationship Id="rId{position() + 200}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="{@r:embed}"/>
          </xsl:when>
          <xsl:otherwise>
            <Relationship Id="rId{position() + 200}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="{@r:link}" TargetMode="External"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
      <!-- TEI images -->
      <xsl:for-each select="key('GRAPHICS',1)">
        <xsl:variable name="n">
          <xsl:choose>
            <xsl:when test="@n">
              <xsl:value-of select="@n"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:number level="any"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <Relationship Id="rId{$n + 300}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="{@url}"/>
      </xsl:for-each>
      <!-- hyperlinks -->
      <!-- 
		<xsl:for-each select="key('TARGETS',1)">
		  <xsl:if test="not(starts-with(@target,'#'))">
                    <Relationship 
			Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"
			Target="{@target}" 
			TargetMode="External">
		      <xsl:attribute name="Id">
			<xsl:text>rId</xsl:text>
			<xsl:variable name="n">
			  <xsl:number level="any"/>
			</xsl:variable>
			<xsl:value-of select="$n + 3000"/>
		      </xsl:attribute>
		    </Relationship>
		  </xsl:if>
		</xsl:for-each>
		-->
      <!-- Formulas -->
      <xsl:for-each select="key('IMAGEDATA',1)">
        <Relationship Id="rId{position() + 1000}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="{@r:id}"/>
      </xsl:for-each>
      <xsl:for-each select="key('OLEOBJECTS',1)">
        <Relationship Id="rId{position() + 2000}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="{@r:id}"/>
      </xsl:for-each>
      <!-- our headers and footers -->
      <xsl:choose>
        <xsl:when test="count(key('ALLHEADERS',1))=0 and count(key('ALLFOOTERS',1))=0">
          <xsl:for-each select="document($defaultHeaderFooterFile)">
            <xsl:call-template name="writeRelationshipsHeadersAndFooters"/>
          </xsl:for-each>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="writeRelationshipsHeadersAndFooters"/>
        </xsl:otherwise>
      </xsl:choose>
    </Relationships>
  </xsl:result-document>
</xsl:template>
Stylesheet location ../../../docx/to/docxfiles/relationships.xsl
Template writeRelationshipsHeadersAndFooters
Namespace No namespace
Used by
References
Import precedence 12
Source
<xsl:template name="writeRelationshipsHeadersAndFooters">
  <xsl:for-each select="key('ALLFOOTERS',1)">
    <xsl:variable name="num">
      <xsl:number/>
    </xsl:variable>
    <Relationship xmlns="http://schemas.openxmlformats.org/package/2006/relationships" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" Target="{concat('footer',position(),'.xml')}" Id="{concat('rId',100+$num)}"/>
  </xsl:for-each>
  <!-- count all footers -->
  <xsl:for-each select="key('ALLHEADERS',1)">
    <xsl:variable name="num">
      <xsl:number/>
    </xsl:variable>
    <Relationship xmlns="http://schemas.openxmlformats.org/package/2006/relationships" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" Target="{concat('header',position(),'.xml')}" Id="{concat('rId',100+$num)}"/>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../../../docx/to/docxfiles/relationships.xsl
Key GRAPHICS
Namespace No namespace
Match tei:graphic[@url]
Use 1
Used by
Source
<xsl:key name="GRAPHICS" use="1" match="tei:graphic[@url]"/>
Stylesheet location ../../../docx/to/docxfiles/relationships.xsl
Key OLEOBJECTS
Namespace No namespace
Match o:OLEObject
Use 1
Used by
Source
<xsl:key name="OLEOBJECTS" use="1" match="o:OLEObject"/>
Stylesheet location ../../../docx/to/docxfiles/relationships.xsl
Key IMAGEDATA
Namespace No namespace
Match v:imagedata
Use 1
Used by
Source
<xsl:key name="IMAGEDATA" use="1" match="v:imagedata"/>
Stylesheet location ../../../docx/to/docxfiles/relationships.xsl