| 1 |
Index: filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
|
| 2 |
===================================================================
|
| 3 |
--- filter/source/xslt/odf2xhtml/export/xhtml/body.xsl (revision 276736)
|
| 4 |
+++ filter/source/xslt/odf2xhtml/export/xhtml/body.xsl (working copy)
|
| 5 |
@@ -61,9 +61,17 @@
|
| 6 |
<xsl:key match="style:master-page" name="masterPageElements" use="@style:name"/>
|
| 7 |
<xsl:key match="style:page-layout" name="pageLayoutElements" use="@style:name"/>
|
| 8 |
<xsl:key name="writingModeStyles" match="/*/office:styles/style:style/style:paragraph-properties/@style:writing-mode | /*/office:automatic-styles/style:style/style:paragraph-properties/@style:writing-mode" use="'test'"/>
|
| 9 |
+
|
| 10 |
<xsl:template name="create-body">
|
| 11 |
<xsl:param name="globalData"/>
|
| 12 |
+ <xsl:call-template name="create-body.collect-page-properties">
|
| 13 |
+ <xsl:with-param name="globalData" select="$globalData"/>
|
| 14 |
+ </xsl:call-template>
|
| 15 |
+ </xsl:template>
|
| 16 |
|
| 17 |
+ <xsl:template name="create-body.collect-page-properties">
|
| 18 |
+ <xsl:param name="globalData"/>
|
| 19 |
+
|
| 20 |
<!-- approximation to find the correct master page style (with page dimensions) -->
|
| 21 |
<xsl:variable name="masterPageNames">
|
| 22 |
<!-- Loop over every style:style containing a @style:master-page-name attribute -->
|
| 23 |
@@ -76,13 +84,13 @@
|
| 24 |
</xsl:if>
|
| 25 |
</xsl:for-each>
|
| 26 |
</xsl:variable>
|
| 27 |
-
|
| 28 |
+
|
| 29 |
<!-- Take the first of the masterpage list and get the according style:master-page element and find the @style:page-layout-name -->
|
| 30 |
<xsl:variable name="pageLayoutName" select="key('masterPageElements', substring-before($masterPageNames,';'))/@style:page-layout-name"/>
|
| 31 |
- <xsl:variable name="pageProperties">
|
| 32 |
+ <xsl:variable name="pagePropertiesRTF">
|
| 33 |
<xsl:choose>
|
| 34 |
<xsl:when test="not($pageLayoutName) or $pageLayoutName = ''">
|
| 35 |
- <xsl:copy-of select="$globalData/styles-file/*/office:automatic-styles/style:page-layout[1]/style:page-layout-properties"/>
|
| 36 |
+ <xsl:value-of select="$globalData/styles-file/*/office:automatic-styles/style:page-layout[1]/style:page-layout-properties"/>
|
| 37 |
</xsl:when>
|
| 38 |
<xsl:otherwise>
|
| 39 |
<!-- Find the according style:page-layout and store the properties in a variable -->
|
| 40 |
@@ -90,6 +98,36 @@
|
| 41 |
</xsl:otherwise>
|
| 42 |
</xsl:choose>
|
| 43 |
</xsl:variable>
|
| 44 |
+
|
| 45 |
+ <xsl:choose>
|
| 46 |
+ <xsl:when test="function-available('common:node-set')">
|
| 47 |
+ <xsl:call-template name="create-body.create">
|
| 48 |
+ <xsl:with-param name="globalData" select="common:node-set($globalData)"/>
|
| 49 |
+ <xsl:with-param name="pageProperties" select="common:node-set($pagePropertiesRTF)"/>
|
| 50 |
+ </xsl:call-template>
|
| 51 |
+ </xsl:when>
|
| 52 |
+ <xsl:when test="function-available('xalan:nodeset')">
|
| 53 |
+ <xsl:call-template name="create-body.create">
|
| 54 |
+ <xsl:with-param name="globalData" select="xalan:nodeset($globalData)"/>
|
| 55 |
+ <xsl:with-param name="pageProperties" select="xalan:nodeset($pagePropertiesRTF)"/>
|
| 56 |
+ </xsl:call-template>
|
| 57 |
+ </xsl:when>
|
| 58 |
+ <xsl:when test="function-available('xt:node-set')">
|
| 59 |
+ <xsl:call-template name="create-body.create">
|
| 60 |
+ <xsl:with-param name="globalData" select="xt:node-set($globalData)"/>
|
| 61 |
+ <xsl:with-param name="pageProperties" select="xt:node-set($pagePropertiesRTF)"/>
|
| 62 |
+ </xsl:call-template>
|
| 63 |
+ </xsl:when>
|
| 64 |
+ <xsl:otherwise>
|
| 65 |
+ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
|
| 66 |
+ </xsl:otherwise>
|
| 67 |
+ </xsl:choose>
|
| 68 |
+ </xsl:template>
|
| 69 |
+
|
| 70 |
+ <xsl:template name="create-body.create">
|
| 71 |
+ <xsl:param name="globalData"/>
|
| 72 |
+ <xsl:param name="pageProperties"/>
|
| 73 |
+
|
| 74 |
<xsl:element name="body">
|
| 75 |
<!-- direction of text flow -->
|
| 76 |
<xsl:variable name="writingMode" select="$pageProperties/style:page-layout-properties/@style:writing-mode"/>
|