mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-11-14 07:10:39 +00:00
集成OpenOffice替换为LibreOffice
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,26 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
|
||||
<xsl:template match="office:meta">
|
||||
<o:DocumentProperties>
|
||||
@@ -123,7 +118,9 @@
|
||||
</o:Language>
|
||||
<xsl:for-each select="meta:user-defined">
|
||||
<!-- transfer strings to XML QName, necessary to convert several characters -->
|
||||
<xsl:element name="{concat( 'o:', translate(@meta:name,'.,| ~`!@#$%^&<>*()+=[]{};:"/\?','_'))}">
|
||||
<!-- {} -->
|
||||
<xsl:variable name="foo">.,| ~`!@#$%^*()&<>+=[];:"/\?{}'</xsl:variable>
|
||||
<xsl:element name="{concat( 'o:', translate(@meta:name,string($foo),'_'))}">
|
||||
<xsl:attribute name="dt:dt">string</xsl:attribute>
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:element>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,160 +1,155 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<!--
|
||||
For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
|
||||
-->
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:xforms="http://www.w3.org/2002/xforms"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi">
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:xforms="http://www.w3.org/2002/xforms"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi">
|
||||
|
||||
|
||||
<!-- table row handling -->
|
||||
<xsl:include href="table_rows.xsl" />
|
||||
<!-- table column handling -->
|
||||
<xsl:include href="table_columns.xsl" />
|
||||
<!-- table cell handling -->
|
||||
<xsl:include href="table_cells.xsl" />
|
||||
<!-- table row handling -->
|
||||
<xsl:include href="table_rows.xsl" />
|
||||
<!-- table column handling -->
|
||||
<xsl:include href="table_columns.xsl" />
|
||||
<!-- table cell handling -->
|
||||
<xsl:include href="table_cells.xsl" />
|
||||
|
||||
<xsl:param name="tableElement" select="'table'" />
|
||||
<xsl:param name="tableElement" select="'table'" />
|
||||
|
||||
<!-- ******************* -->
|
||||
<!-- *** main table *** -->
|
||||
<!-- ******************* -->
|
||||
<!-- ******************* -->
|
||||
<!-- *** main table *** -->
|
||||
<!-- ******************* -->
|
||||
|
||||
|
||||
<xsl:template match="table:table" name="table:table">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:template match="table:table" name="table:table">
|
||||
<xsl:param name="globalData" />
|
||||
|
||||
<!-- The table will only be created if the table:scenario is active -->
|
||||
<xsl:if test="not(table:scenario) or table:scenario/@table:is-active">
|
||||
<xsl:call-template name="create-table">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<!-- The table will only be created if the table:scenario is active -->
|
||||
<xsl:if test="not(table:scenario) or table:scenario/@table:is-active">
|
||||
<xsl:call-template name="create-table">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<xsl:template name="create-table">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:template name="create-table">
|
||||
<xsl:param name="globalData" />
|
||||
|
||||
<!-- by default '1', for each new sub/inner/nested table the number counts one up -->
|
||||
<xsl:variable name="tableLevel" select="count(ancestor-or-self::table:table)" />
|
||||
<!-- collecting all visible "table:table-row" elements of the table -->
|
||||
<xsl:variable name="allVisibleTableRows" select="table:table-row[not(@table:visibility = 'collapse' or @table:visibility = 'filter')][count(ancestor-or-self::table:table) = $tableLevel] |
|
||||
table:table-header-rows/descendant::table:table-row[not(@table:visibility = 'collapse' or @table:visibility = 'filter')][count(ancestor-or-self::table:table) = $tableLevel] |
|
||||
table:table-row-group/descendant::table:table-row[not(@table:visibility = 'collapse' or @table:visibility = 'filter')][count(ancestor-or-self::table:table) = $tableLevel]" />
|
||||
<!-- As the alignment of a table is by 'align' attribut is deprecated and as the CSS 'float' attribute not well displayed,
|
||||
we do a trick by encapsulating the table with a aligned 'div' element-->
|
||||
<xsl:variable name="table-alignment" select="key('styles', @style:name = current()/@table:style-name)/*/@table:align" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($table-alignment) != 0">
|
||||
<xsl:element namespace="{$namespace}" name="div">
|
||||
<xsl:attribute name="style">
|
||||
<xsl:choose>
|
||||
<xsl:when test='$table-alignment="left" or $table-alignment="margins"'>
|
||||
<xsl:text>text-align:left</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test='$table-alignment="right"'>
|
||||
<xsl:text>text-align:right</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test='$table-alignment="center"'>
|
||||
<xsl:text>text-align:center</xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:call-template name="create-table-element">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
</xsl:call-template>
|
||||
</xsl:element>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="create-table-element">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<!-- by default '1', for each new sub/inner/nested table the number counts one up -->
|
||||
<xsl:variable name="tableLevel" select="count(ancestor-or-self::table:table)" />
|
||||
<!-- collecting all visible "table:table-row" elements of the table -->
|
||||
<xsl:variable name="allVisibleTableRows" select="table:table-row[not(@table:visibility = 'collapse' or @table:visibility = 'filter')][count(ancestor-or-self::table:table) = $tableLevel] |
|
||||
table:table-header-rows/descendant::table:table-row[not(@table:visibility = 'collapse' or @table:visibility = 'filter')][count(ancestor-or-self::table:table) = $tableLevel] |
|
||||
table:table-row-group/descendant::table:table-row[not(@table:visibility = 'collapse' or @table:visibility = 'filter')][count(ancestor-or-self::table:table) = $tableLevel]" />
|
||||
<!-- As the alignment of a table is by 'align' attribute is deprecated and as the CSS 'float' attribute not well displayed,
|
||||
we do a trick by encapsulating the table with an aligned 'div' element-->
|
||||
<xsl:variable name="table-alignment" select="key('styles', @style:name = current()/@table:style-name)/*/@table:align" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($table-alignment) != 0">
|
||||
<xsl:element namespace="{$namespace}" name="div">
|
||||
<xsl:attribute name="style">
|
||||
<xsl:choose>
|
||||
<xsl:when test='$table-alignment="left" or $table-alignment="margins"'>
|
||||
<xsl:text>text-align:left</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test='$table-alignment="right"'>
|
||||
<xsl:text>text-align:right</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test='$table-alignment="center"'>
|
||||
<xsl:text>text-align:center</xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:call-template name="create-table-element">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
</xsl:call-template>
|
||||
</xsl:element>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="create-table-element">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="create-table-element">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allVisibleTableRows" />
|
||||
<xsl:template name="create-table-element">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allVisibleTableRows" />
|
||||
|
||||
<xsl:element namespace="{$namespace}" name="{$tableElement}">
|
||||
<xsl:attribute name="border">0</xsl:attribute>
|
||||
<xsl:attribute name="cellspacing">0</xsl:attribute>
|
||||
<xsl:attribute name="cellpadding">0</xsl:attribute>
|
||||
<xsl:choose>
|
||||
<xsl:when test='name()="table:table"'>
|
||||
<xsl:variable name="value" select="$globalData/all-doc-styles/style[@style:name = current()/@table:style-name]/*/@style:rel-width" />
|
||||
<xsl:if test="$value">
|
||||
<xsl:attribute name="width">
|
||||
<xsl:value-of select="$value" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:attribute name="width">100%</xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:element namespace="{$namespace}" name="{$tableElement}">
|
||||
<xsl:attribute name="border">0</xsl:attribute>
|
||||
<xsl:attribute name="cellspacing">0</xsl:attribute>
|
||||
<xsl:attribute name="cellpadding">0</xsl:attribute>
|
||||
<xsl:choose>
|
||||
<xsl:when test='name()="table:table"'>
|
||||
<xsl:variable name="value" select="$globalData/all-doc-styles/style[@style:name = current()/@table:style-name]/*/@style:rel-width" />
|
||||
<xsl:if test="$value">
|
||||
<xsl:attribute name="width">
|
||||
<xsl:value-of select="$value" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:attribute name="width">100%</xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:apply-templates select="@table:style-name">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="@table:style-name">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:apply-templates>
|
||||
|
||||
<xsl:call-template name="create-column-style-variable">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
</xsl:call-template>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
<xsl:call-template name="create-column-style-variable">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
</xsl:call-template>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,239 +1,232 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<!--
|
||||
For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
|
||||
-->
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:xforms="http://www.w3.org/2002/xforms"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xt="http://www.jclark.com/xt"
|
||||
xmlns:common="http://exslt.org/common"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi xt common xalan">
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:xforms="http://www.w3.org/2002/xforms"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xt="http://www.jclark.com/xt"
|
||||
xmlns:common="http://exslt.org/common"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi xt common xalan">
|
||||
|
||||
<xsl:param name="tableColumnElement" select="'col'" />
|
||||
<xsl:param name="tableColumnElement" select="'col'" />
|
||||
|
||||
<!-- ******************************************** -->
|
||||
<!-- *** Create table columns style variable *** -->
|
||||
<!-- ******************************************** -->
|
||||
<!-- ******************************************** -->
|
||||
<!-- *** Create table columns style variable *** -->
|
||||
<!-- ******************************************** -->
|
||||
|
||||
<!-- current node is a table:table -->
|
||||
<xsl:template name="create-column-style-variable">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allVisibleTableRows" />
|
||||
<!-- current node is a table:table -->
|
||||
<xsl:template name="create-column-style-variable">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allVisibleTableRows" />
|
||||
|
||||
<!-- all columns of the table -->
|
||||
<xsl:variable name="allTableColumns" select="table:table-column |
|
||||
table:table-column-group/descendant::table:table-column |
|
||||
table:table-header-columns/descendant::table:table-column" />
|
||||
<!-- allTableColumns: Containing all columns of the table, hidden and viewed.
|
||||
- if a column is hidden, if table:visibility has the value 'collapse' or 'filter', otherwise the value is 'visible'
|
||||
- if a column is being repeated, each repeated column is explicitly written as entry in this variable.
|
||||
Later (during template "write-cell") the style of the column will be mixed with the cell-style by using
|
||||
the position() of the column entry and comparing it with the iterating cell number. -->
|
||||
<xsl:variable name="allTableColumns-RTF">
|
||||
<xsl:for-each select="$allTableColumns">
|
||||
<xsl:call-template name="adding-column-styles-entries">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<!-- all columns of the table -->
|
||||
<xsl:variable name="allTableColumns" select="table:table-column |
|
||||
table:table-column-group/descendant::table:table-column |
|
||||
table:table-header-columns/descendant::table:table-column" />
|
||||
<!-- allTableColumns: Containing all columns of the table, hidden and viewed.
|
||||
- if a column is hidden, if table:visibility has the value 'collapse' or 'filter', otherwise the value is 'visible'
|
||||
- if a column is being repeated, each repeated column is explicitly written as entry in this variable.
|
||||
Later (during template "write-cell") the style of the column will be mixed with the cell-style by using
|
||||
the position() of the column entry and comparing it with the iterating cell number. -->
|
||||
<xsl:variable name="allTableColumns-RTF">
|
||||
<xsl:for-each select="$allTableColumns">
|
||||
<xsl:call-template name="adding-column-styles-entries">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="function-available('common:node-set')">
|
||||
<xsl:call-template name="create-table-children">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
<xsl:with-param name="allTableColumns" select="common:node-set($allTableColumns-RTF)" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="function-available('xalan:nodeset')">
|
||||
<xsl:call-template name="create-table-children">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
<xsl:with-param name="allTableColumns" select="xalan:nodeset($allTableColumns-RTF)" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="function-available('xt:node-set')">
|
||||
<xsl:call-template name="create-table-children">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
<xsl:with-param name="allTableColumns" select="xt:node-set($allTableColumns-RTF)" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<xsl:choose>
|
||||
<xsl:when test="function-available('common:node-set')">
|
||||
<xsl:call-template name="create-table-children">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
<xsl:with-param name="allTableColumns" select="common:node-set($allTableColumns-RTF)" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="function-available('xalan:nodeset')">
|
||||
<xsl:call-template name="create-table-children">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
<xsl:with-param name="allTableColumns" select="xalan:nodeset($allTableColumns-RTF)" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="function-available('xt:node-set')">
|
||||
<xsl:call-template name="create-table-children">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
<xsl:with-param name="allTableColumns" select="xt:node-set($allTableColumns-RTF)" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!-- current node is a table:table -->
|
||||
<xsl:template name="create-table-children">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allVisibleTableRows" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
<!-- current node is a table:table -->
|
||||
<xsl:template name="create-table-children">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allVisibleTableRows" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
|
||||
|
||||
<xsl:for-each select="$allTableColumns/table:table-column">
|
||||
<xsl:if test="not(@table:visibility = 'collapse' or @table:visibility = 'filter')">
|
||||
<xsl:for-each select="$allTableColumns/table:table-column">
|
||||
<xsl:if test="not(@table:visibility = 'collapse' or @table:visibility = 'filter')">
|
||||
|
||||
<xsl:call-template name="create-column-element">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:call-template name="create-column-element">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:call-template name="create-table-rows">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
<xsl:call-template name="create-table-rows">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<!-- To be OVERWRITTEN -->
|
||||
<xsl:template name="create-column-element" />
|
||||
<!-- To be OVERWRITTEN -->
|
||||
<xsl:template name="create-column-element" />
|
||||
|
||||
<!-- current node is a table:table-column -->
|
||||
<xsl:template name="adding-column-styles-entries">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
<!-- current node is a table:table-column -->
|
||||
<xsl:template name="adding-column-styles-entries">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
|
||||
<xsl:choose>
|
||||
<!-- if parser reads DTD the default is set to '1' -->
|
||||
<xsl:when test="not(@table:number-columns-repeated and @table:number-columns-repeated > 1)">
|
||||
<!-- writes an entry of a column in the columns-variable -->
|
||||
<xsl:copy-of select="." />
|
||||
</xsl:when>
|
||||
<!-- No higher repetition of cells greater than 99 for the last and second last column.
|
||||
This is a workaround for some sample document (Waehrungsumrechner.sxc),
|
||||
having 230 repeated columns in the second last column to emulate background -->
|
||||
<!-- NOTE: Testcase with a table containing table:table-column-group and/or table:table-header-columns -->
|
||||
<xsl:when test="(last() or (last() - 1)) and @table:number-columns-repeated > 99">
|
||||
<!-- writes an entry of a column in the columns-variable -->
|
||||
<xsl:call-template name="repeat-adding-table-column">
|
||||
<xsl:with-param name="numberColumnsRepeated" select="1" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- repeated colums will be written explicit several times in the variable-->
|
||||
<xsl:call-template name="repeat-adding-table-column">
|
||||
<xsl:with-param name="numberColumnsRepeated" select="@table:number-columns-repeated" />
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<xsl:choose>
|
||||
<!-- if parser reads DTD the default is set to '1' -->
|
||||
<xsl:when test="not(@table:number-columns-repeated and @table:number-columns-repeated > 1)">
|
||||
<!-- writes an entry of a column in the columns-variable -->
|
||||
<xsl:copy-of select="." />
|
||||
</xsl:when>
|
||||
<!-- No higher repetition of cells greater than 99 for the last and second last column.
|
||||
This is a workaround for some sample document (Waehrungsumrechner.sxc),
|
||||
having 230 repeated columns in the second last column to emulate background -->
|
||||
<!-- NOTE: Testcase with a table containing table:table-column-group and/or table:table-header-columns -->
|
||||
<xsl:when test="(last() or (last() - 1)) and @table:number-columns-repeated > 99">
|
||||
<!-- writes an entry of a column in the columns-variable -->
|
||||
<xsl:call-template name="repeat-adding-table-column">
|
||||
<xsl:with-param name="numberColumnsRepeated" select="1" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- repeated columns will be written explicit several times in the variable-->
|
||||
<xsl:call-template name="repeat-adding-table-column">
|
||||
<xsl:with-param name="numberColumnsRepeated" select="@table:number-columns-repeated" />
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- WRITES THE REPEATED COLUMN STYLE EXPLICIT AS AN ELEMENT IN THE COLUMNS-VARIABLE -->
|
||||
<!-- current node is a table:table-column -->
|
||||
<xsl:template name="repeat-adding-table-column">
|
||||
<xsl:param name="table:table-column" />
|
||||
<xsl:param name="numberColumnsRepeated" />
|
||||
<!-- WRITES THE REPEATED COLUMN STYLE EXPLICIT AS AN ELEMENT IN THE COLUMNS-VARIABLE -->
|
||||
<!-- current node is a table:table-column -->
|
||||
<xsl:template name="repeat-adding-table-column">
|
||||
<xsl:param name="table:table-column" />
|
||||
<xsl:param name="numberColumnsRepeated" />
|
||||
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$numberColumnsRepeated > 1">
|
||||
<!-- writes an entry of a column in the columns-variable -->
|
||||
<xsl:copy-of select="." />
|
||||
<!-- repeat calling this method until all elements written out -->
|
||||
<xsl:call-template name="repeat-adding-table-column">
|
||||
<xsl:with-param name="numberColumnsRepeated" select="$numberColumnsRepeated - 1" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- writes an entry of a column in the columns-variable -->
|
||||
<xsl:copy-of select="." />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$numberColumnsRepeated > 1">
|
||||
<!-- writes an entry of a column in the columns-variable -->
|
||||
<xsl:copy-of select="." />
|
||||
<!-- repeat calling this method until all elements written out -->
|
||||
<xsl:call-template name="repeat-adding-table-column">
|
||||
<xsl:with-param name="numberColumnsRepeated" select="$numberColumnsRepeated - 1" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- writes an entry of a column in the columns-variable -->
|
||||
<xsl:copy-of select="." />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!--debugEnabled-START-->
|
||||
<!-- giving out the 'allColumnStyle' variable:
|
||||
For each 'table:table-column' of the 'allTableColumns' variable the style-name is given out.
|
||||
In case of 'column-hidden-flag' attribute the text 'Column is hidden is given out.-->
|
||||
<!-- current node is a table:table -->
|
||||
<xsl:template name="table-debug-allTableColumns">
|
||||
<xsl:param name="allTableColumns" />
|
||||
<!--debugEnabled-START-->
|
||||
<!-- giving out the 'allColumnStyle' variable:
|
||||
For each 'table:table-column' of the 'allTableColumns' variable the style-name is given out.
|
||||
In case of 'column-hidden-flag' attribute the text 'Column is hidden is given out.-->
|
||||
<!-- current node is a table:table -->
|
||||
<xsl:template name="table-debug-allTableColumns">
|
||||
<xsl:param name="allTableColumns" />
|
||||
|
||||
<!-- debug output as table summary attribut in html -->
|
||||
<xsl:attribute name="summary">
|
||||
<xsl:call-template name="table-debug-column-out">
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:attribute>
|
||||
<!-- debug output to console -->
|
||||
<xsl:message>
|
||||
<xsl:call-template name="table-debug-column-out">
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:message>
|
||||
</xsl:template>
|
||||
<!-- debug output as table summary attribute in html -->
|
||||
<xsl:attribute name="summary">
|
||||
<xsl:call-template name="table-debug-column-out">
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:attribute>
|
||||
<!-- debug output to console -->
|
||||
<xsl:message>
|
||||
<xsl:call-template name="table-debug-column-out">
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:message>
|
||||
</xsl:template>
|
||||
|
||||
<!-- current node is a table:table -->
|
||||
<xsl:template name="table-debug-column-out">
|
||||
<xsl:param name="allTableColumns" />
|
||||
<xsl:text>
|
||||
DebugInformation: For each 'table:table-column' of the 'allTableColumns' variable the style-name is given out.
|
||||
In case of table:visibility attribute unequal 'visible' the 'column is hidden' no text is given out.
|
||||
</xsl:text>
|
||||
<xsl:for-each select="$allTableColumns/table:table-column">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@table:visibility = 'collapse' or @table:visibility = 'filter' ">
|
||||
<xsl:text> </xsl:text><xsl:value-of select="@table:style-name" /><xsl:text>column is hidden</xsl:text><xsl:text>
|
||||
</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text> </xsl:text><xsl:value-of select="@table:style-name" /><xsl:text> </xsl:text><xsl:value-of select="@table:default-cell-style-name" /><xsl:text>
|
||||
</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
<!--debugEnabled-END-->
|
||||
<!-- current node is a table:table -->
|
||||
<xsl:template name="table-debug-column-out">
|
||||
<xsl:param name="allTableColumns" />
|
||||
<xsl:text>
|
||||
DebugInformation: For each 'table:table-column' of the 'allTableColumns' variable the style-name is given out.
|
||||
In case of table:visibility attribute unequal 'visible' the 'column is hidden' no text is given out.
|
||||
</xsl:text>
|
||||
<xsl:for-each select="$allTableColumns/table:table-column">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@table:visibility = 'collapse' or @table:visibility = 'filter' ">
|
||||
<xsl:text> </xsl:text><xsl:value-of select="@table:style-name" /><xsl:text>column is hidden</xsl:text><xsl:text></xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text> </xsl:text><xsl:value-of select="@table:style-name" /><xsl:text> </xsl:text><xsl:value-of select="@table:default-cell-style-name" /><xsl:text></xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
<!--debugEnabled-END-->
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
@@ -1,208 +1,203 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<!--
|
||||
For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
|
||||
-->
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:xforms="http://www.w3.org/2002/xforms"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi">
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:xforms="http://www.w3.org/2002/xforms"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi">
|
||||
|
||||
|
||||
<xsl:param name="rowElement" select="'tr'" />
|
||||
<xsl:param name="rowElement" select="'tr'" />
|
||||
|
||||
<!-- ********************************** -->
|
||||
<!-- *** write repeating table rows *** -->
|
||||
<!-- ********************************** -->
|
||||
<!-- ********************************** -->
|
||||
<!-- *** write repeating table rows *** -->
|
||||
<!-- ********************************** -->
|
||||
|
||||
<!-- current node is a table:table -->
|
||||
<xsl:template name="create-table-rows">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allVisibleTableRows" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
<!-- current node is a table:table -->
|
||||
<xsl:template name="create-table-rows">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allVisibleTableRows" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
|
||||
<!-- Some Office Calc documents simulate a background by repeating one of the later cells until end of used space
|
||||
(The value of "table:number-columns-repeated" is enourmous). Writing out all these cells would be fatal in time
|
||||
and output size. Therefore, this global variable shows us the longest row with content. -->
|
||||
<xsl:variable name="maxRowLength" select="count($allTableColumns/table:table-column)" />
|
||||
<xsl:if test="$debugEnabled">
|
||||
<xsl:message>maxRowLength: <xsl:value-of select="$maxRowLength" /></xsl:message>
|
||||
<xsl:call-template name="table-debug-allTableColumns">
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
<!-- Some Office Calc documents simulate a background by repeating one of the later cells until end of used space
|
||||
(The value of "table:number-columns-repeated" is enormous). Writing out all these cells would be fatal in time
|
||||
and output size. Therefore, this global variable shows us the longest row with content. -->
|
||||
<xsl:variable name="maxRowLength" select="count($allTableColumns/table:table-column)" />
|
||||
<xsl:if test="$debugEnabled">
|
||||
<xsl:message>maxRowLength: <xsl:value-of select="$maxRowLength" /></xsl:message>
|
||||
<xsl:call-template name="table-debug-allTableColumns">
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
|
||||
<!-- a table is a table header, when it has a "table:table-header-rows" ancestor -->
|
||||
<xsl:variable name="tableDataType">
|
||||
<xsl:choose>
|
||||
<xsl:when test="ancestor::table:table-header-rows">
|
||||
<xsl:text>th</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>td</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<!-- a table is a table header, when it has a "table:table-header-rows" ancestor -->
|
||||
<xsl:variable name="tableDataType">
|
||||
<xsl:choose>
|
||||
<xsl:when test="ancestor::table:table-header-rows">
|
||||
<xsl:text>th</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>td</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<!-- removes repetition of rows, most probably done for background emulating -->
|
||||
<xsl:for-each select="$allVisibleTableRows">
|
||||
<xsl:choose>
|
||||
<xsl:when test="(last() or (last() - 1)) and @table:number-rows-repeated > 99">
|
||||
<xsl:call-template name="repeat-write-row">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
<xsl:with-param name="numberRowsRepeated" select="1" />
|
||||
<xsl:with-param name="maxRowLength" select="$maxRowLength" />
|
||||
<xsl:with-param name="tableDataType" select="$tableDataType" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="repeat-write-row">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
<xsl:with-param name="numberRowsRepeated" select="@table:number-rows-repeated" />
|
||||
<xsl:with-param name="maxRowLength" select="$maxRowLength" />
|
||||
<xsl:with-param name="tableDataType" select="$tableDataType" />
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
<!-- removes repetition of rows, most probably done for background emulating -->
|
||||
<xsl:for-each select="$allVisibleTableRows">
|
||||
<xsl:choose>
|
||||
<xsl:when test="(last() or (last() - 1)) and @table:number-rows-repeated > 99">
|
||||
<xsl:call-template name="repeat-write-row">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
<xsl:with-param name="numberRowsRepeated" select="1" />
|
||||
<xsl:with-param name="maxRowLength" select="$maxRowLength" />
|
||||
<xsl:with-param name="tableDataType" select="$tableDataType" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="repeat-write-row">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
<xsl:with-param name="numberRowsRepeated" select="@table:number-rows-repeated" />
|
||||
<xsl:with-param name="maxRowLength" select="$maxRowLength" />
|
||||
<xsl:with-param name="tableDataType" select="$tableDataType" />
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="repeat-write-row">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
<xsl:param name="numberRowsRepeated" select="1" />
|
||||
<xsl:param name="maxRowLength" />
|
||||
<xsl:param name="tableDataType" />
|
||||
<xsl:template name="repeat-write-row">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
<xsl:param name="numberRowsRepeated" select="1" />
|
||||
<xsl:param name="maxRowLength" />
|
||||
<xsl:param name="tableDataType" />
|
||||
|
||||
<xsl:choose>
|
||||
<!-- write an entry of a row and repeat calling this method until all elements are written out -->
|
||||
<xsl:when test="$numberRowsRepeated > 1 and table:table-cell">
|
||||
<xsl:call-template name="write-row">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
<xsl:with-param name="maxRowLength" select="$maxRowLength" />
|
||||
<xsl:with-param name="tableDataType" select="$tableDataType" />
|
||||
</xsl:call-template>
|
||||
<xsl:choose>
|
||||
<!-- write an entry of a row and repeat calling this method until all elements are written out -->
|
||||
<xsl:when test="$numberRowsRepeated > 1 and table:table-cell">
|
||||
<xsl:call-template name="write-row">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
<xsl:with-param name="maxRowLength" select="$maxRowLength" />
|
||||
<xsl:with-param name="tableDataType" select="$tableDataType" />
|
||||
</xsl:call-template>
|
||||
|
||||
<!-- NOTE: take variable from the output of repeated write-row and iterate giving out the variable -->
|
||||
<xsl:call-template name="repeat-write-row">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
<xsl:with-param name="maxRowLength" select="$maxRowLength" />
|
||||
<xsl:with-param name="numberRowsRepeated" select="$numberRowsRepeated - 1" />
|
||||
<xsl:with-param name="tableDataType" select="$tableDataType" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<!-- write a single entry of a row -->
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="write-row">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
<xsl:with-param name="maxRowLength" select="$maxRowLength" />
|
||||
<xsl:with-param name="tableDataType" select="$tableDataType" />
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<!-- NOTE: take variable from the output of repeated write-row and iterate giving out the variable -->
|
||||
<xsl:call-template name="repeat-write-row">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
<xsl:with-param name="maxRowLength" select="$maxRowLength" />
|
||||
<xsl:with-param name="numberRowsRepeated" select="$numberRowsRepeated - 1" />
|
||||
<xsl:with-param name="tableDataType" select="$tableDataType" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<!-- write a single entry of a row -->
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="write-row">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
<xsl:with-param name="maxRowLength" select="$maxRowLength" />
|
||||
<xsl:with-param name="tableDataType" select="$tableDataType" />
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="add-table-row-attributes">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:template name="add-table-row-attributes">
|
||||
<xsl:param name="globalData" />
|
||||
|
||||
<!-- writing the style of the row -->
|
||||
<xsl:if test="@table:style-name">
|
||||
<xsl:call-template name='add-style-properties'>
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<!-- writing the style of the row -->
|
||||
<xsl:if test="@table:style-name">
|
||||
<xsl:call-template name='add-style-properties'>
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="write-row">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
<xsl:param name="maxRowLength" />
|
||||
<xsl:param name="tableDataType" />
|
||||
<xsl:template name="write-row">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
<xsl:param name="maxRowLength" />
|
||||
<xsl:param name="tableDataType" />
|
||||
|
||||
|
||||
<xsl:element namespace="{$namespace}" name="{$rowElement}">
|
||||
<xsl:call-template name='add-table-row-attributes'>
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
<xsl:element namespace="{$namespace}" name="{$rowElement}">
|
||||
<xsl:call-template name='add-table-row-attributes'>
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:if test="$debugEnabled">
|
||||
<xsl:message>'tr' element has been added!</xsl:message>
|
||||
</xsl:if>
|
||||
<xsl:if test="$debugEnabled">
|
||||
<xsl:message>'tr' element has been added!</xsl:message>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:apply-templates select="table:table-cell">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
<xsl:with-param name="maxRowLength" select="$maxRowLength" />
|
||||
<xsl:with-param name="tableDataType" select="$tableDataType" />
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="table:table-cell">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
<xsl:with-param name="maxRowLength" select="$maxRowLength" />
|
||||
<xsl:with-param name="tableDataType" select="$tableDataType" />
|
||||
</xsl:apply-templates>
|
||||
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- **************************** -->
|
||||
<!-- *** HELPER: table styles *** -->
|
||||
<!-- **************************** -->
|
||||
<!-- **************************** -->
|
||||
<!-- *** HELPER: table styles *** -->
|
||||
<!-- **************************** -->
|
||||
|
||||
<xsl:template name="add-style-properties">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
<xsl:param name="node-position" />
|
||||
<xsl:template name="add-style-properties">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
<xsl:param name="node-position" />
|
||||
|
||||
<xsl:attribute name="class">
|
||||
<xsl:value-of select="translate(@table:style-name, '. %()/\+', '')" />
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:value-of select="translate(@table:style-name, '. %()/\+', '')" />
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,142 +1,137 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xlink">
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xlink">
|
||||
|
||||
|
||||
<!--+++++ INCLUDED XSL MODULES +++++-->
|
||||
<!--+++++ INCLUDED XSL MODULES +++++-->
|
||||
|
||||
<!-- helper collection, to convert measures (e.g. inch to pixel using DPI (dots per inch) parameter)-->
|
||||
<xsl:import href="../../common/measure_conversion.xsl" />
|
||||
<!-- helper collection, to convert measures (e.g. inch to pixel using DPI (dots per inch) parameter)-->
|
||||
<xsl:import href="../../common/measure_conversion.xsl" />
|
||||
|
||||
<!-- excel table handling -->
|
||||
<xsl:include href="table.xsl" />
|
||||
<!-- excel table handling -->
|
||||
<xsl:include href="table.xsl" />
|
||||
|
||||
<!-- mapping rules of office style properties to Excel style properties -->
|
||||
<xsl:include href="style_mapping.xsl" />
|
||||
<!-- mapping rules of office style properties to Excel style properties -->
|
||||
<xsl:include href="style_mapping.xsl" />
|
||||
|
||||
<!-- creating the Excel styles element -->
|
||||
<xsl:include href="styles.xsl" />
|
||||
<!-- creating the Excel styles element -->
|
||||
<xsl:include href="styles.xsl" />
|
||||
|
||||
<!-- mapping formalar Expressions -->
|
||||
<xsl:include href="formular.xsl" />
|
||||
<!-- mapping formular Expressions -->
|
||||
<xsl:include href="formular.xsl" />
|
||||
|
||||
<xsl:output method = "xml"
|
||||
indent = "no"
|
||||
encoding = "UTF-8"
|
||||
omit-xml-declaration = "no" />
|
||||
<xsl:output method = "xml"
|
||||
indent = "no"
|
||||
encoding = "UTF-8"
|
||||
omit-xml-declaration = "no" />
|
||||
|
||||
<xsl:strip-space elements="ss:Data html:Data" />
|
||||
<xsl:strip-space elements="ss:Data html:Data" />
|
||||
|
||||
|
||||
<!-- common table handling -->
|
||||
<xsl:variable name="namespace" select="'urn:schemas-microsoft-com:office:spreadsheet'" />
|
||||
<!-- common table handling -->
|
||||
<xsl:variable name="namespace" select="'urn:schemas-microsoft-com:office:spreadsheet'" />
|
||||
|
||||
<!--+++++ PARAMETER SECTION +++++-->
|
||||
<!--+++++ PARAMETER SECTION +++++-->
|
||||
|
||||
<!-- OPTIONAL: (MANDATORY: for all input document with relative external links): parameter is a (relative) URL to the target directory.
|
||||
Relative links from the office document (e.g. to external graphics) will get this parameter as a prefix -->
|
||||
<xsl:param name="targetBaseURL" select="'./'" />
|
||||
<!-- OPTIONAL: (MANDATORY: for all input document with relative external links): parameter is a (relative) URL to the target directory.
|
||||
Relative links from the office document (e.g. to external graphics) will get this parameter as a prefix -->
|
||||
<xsl:param name="targetBaseURL" select="'./'" />
|
||||
|
||||
<!-- OPTIONAL: (MANDATORY: for input document with relative internal links)
|
||||
To access contents of a office file (content like the meta.xml, styles.xml file or graphics) a URL could be choosen.
|
||||
This could be even a JAR URL. The sourceBase of the content URL "jar:file:/C:/temp/Test.sxw!/content.xml" would be
|
||||
"jar:file:/C:/temp/Test.sxw!/" for example.
|
||||
When working with OpenOffice API a Package-URL encoded over HTTP can be used to access the jared contents of the the jared document. -->
|
||||
<xsl:param name="sourceBaseURL" select="'./'" />
|
||||
<!-- OPTIONAL: (MANDATORY: for input document with relative internal links)
|
||||
To access contents of an office file (content like the meta.xml, styles.xml file or graphics) a URL could be chosen.
|
||||
This could be even a JAR URL. The sourceBase of the content URL "jar:file:/C:/temp/Test.sxw!/content.xml" would be
|
||||
"jar:file:/C:/temp/Test.sxw!/" for example.
|
||||
When working with OpenOffice API a Package-URL encoded over HTTP can be used to access the jared contents of the jared document. -->
|
||||
<xsl:param name="sourceBaseURL" select="'./'" />
|
||||
|
||||
<!-- OPTIONAL: (MANDATORY: for session management by URL rewriting)
|
||||
Useful for WebApplications: if a HTTP session is not cookie based, URL rewriting is beeing used (the session is appended to the URL).
|
||||
This URL session is used for example when links to graphics are created by XSLT. Otherwise the user havt to log again in for every graphic he liks to see. -->
|
||||
<xsl:param name="optionalURLSuffix" />
|
||||
<!-- OPTIONAL: (MANDATORY: for session management by URL rewriting)
|
||||
Useful for WebApplications: if a HTTP session is not cookie based, URL rewriting is being used (the session is appended to the URL).
|
||||
This URL session is used for example when links to graphics are created by XSLT. Otherwise the user has to log again in for every graphic he likes to see. -->
|
||||
<xsl:param name="optionalURLSuffix" />
|
||||
|
||||
<!-- OPTIONAL: URL to office meta file (flat xml use the URL to the input file) -->
|
||||
<xsl:param name="metaFileURL" />
|
||||
<!-- OPTIONAL: URL to office meta file (flat xml use the URL to the input file) -->
|
||||
<xsl:param name="metaFileURL" />
|
||||
|
||||
<!-- OPTIONAL: URL to office meta file (flat xml use the URL to the input file) -->
|
||||
<xsl:param name="stylesFileURL" />
|
||||
<!-- OPTIONAL: URL to office meta file (flat xml use the URL to the input file) -->
|
||||
<xsl:param name="stylesFileURL" />
|
||||
|
||||
<!-- OPTIONAL: in case of using a different processor than a JAVA XSLT, you can unable the Java functionality
|
||||
(e.g. encoding chapter names for the content-table as href and anchors ) -->
|
||||
<xsl:param name="java" select="true()" />
|
||||
<xsl:param name="javaEnabled" select="boolean($java)" />
|
||||
<!-- OPTIONAL: in case of using a different processor than a JAVA XSLT, you can unable the Java functionality
|
||||
(e.g. encoding chapter names for the content-table as href and anchors ) -->
|
||||
<xsl:param name="java" select="true()" />
|
||||
<xsl:param name="javaEnabled" select="boolean($java)" />
|
||||
|
||||
<!-- OPTIONAL: for activating the debug mode set the variable here to 'true()' or give any value from outside -->
|
||||
<xsl:param name="debug" select="false()" />
|
||||
<xsl:param name="debugEnabled" select="boolean($debug)" />
|
||||
<!-- OPTIONAL: for activating the debug mode set the variable here to 'true()' or give any value from outside -->
|
||||
<xsl:param name="debug" select="false()" />
|
||||
<xsl:param name="debugEnabled" select="boolean($debug)" />
|
||||
|
||||
<!-- matching configuration entries -->
|
||||
<xsl:key name="config" use="@config:name"
|
||||
match="/*/office:settings/config:config-item-set/config:config-item-map-indexed/config:config-item-map-entry/config:config-item |
|
||||
/*/office:settings/config:config-item-set/config:config-item-map-indexed/config:config-item-map-entry/config:config-item-map-named/config:config-item-map-entry/config:config-item" />
|
||||
<!-- matching configuration entries -->
|
||||
<xsl:key name="config" use="@config:name"
|
||||
match="/*/office:settings/config:config-item-set/config:config-item-map-indexed/config:config-item-map-entry/config:config-item |
|
||||
/*/office:settings/config:config-item-set/config:config-item-map-indexed/config:config-item-map-entry/config:config-item-map-named/config:config-item-map-entry/config:config-item" />
|
||||
|
||||
<xsl:key name="colors" match="/*/office:styles//@*[name() = 'fo:background-color' or name() = 'fo:color'] |
|
||||
/*/office:automatic-styles//@*[name() = 'fo:background-color' or name() = 'fo:color']" use="/" />
|
||||
<xsl:key name="colorRGB" match="@fo:background-color | @fo:color" use="." />
|
||||
<!-- *************************** -->
|
||||
<!-- *** Built up Excel file *** -->
|
||||
<!-- *************************** -->
|
||||
<xsl:template match="/">
|
||||
<xsl:processing-instruction name="mso-application">progid="Excel.Sheet"</xsl:processing-instruction>
|
||||
<!-- Note: for debugging purpose include schema location
|
||||
<Workbook xsi:schemaLocation="urn:schemas-microsoft-com:office:spreadsheet <YOUR_SCHEMA_URL>/excelss.xsd"> -->
|
||||
<Workbook>
|
||||
<!-- adding some default settings -->
|
||||
<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
|
||||
<Colors>
|
||||
<xsl:for-each select="key('colors', /)
|
||||
[generate-id(.) =
|
||||
generate-id(key('colorRGB', .)[1]) and starts-with(., '#')] ">
|
||||
<xsl:sort select="." />
|
||||
<Color>
|
||||
<Index><xsl:value-of select="position() + 2" /></Index>
|
||||
<RGB><xsl:value-of select="." /></RGB>
|
||||
</Color>
|
||||
</xsl:for-each>
|
||||
<xsl:key name="colors" match="/*/office:styles//@*[name() = 'fo:background-color' or name() = 'fo:color'] |
|
||||
/*/office:automatic-styles//@*[name() = 'fo:background-color' or name() = 'fo:color']" use="/" />
|
||||
<xsl:key name="colorRGB" match="@fo:background-color | @fo:color" use="." />
|
||||
<!-- *************************** -->
|
||||
<!-- *** Built up Excel file *** -->
|
||||
<!-- *************************** -->
|
||||
<xsl:template match="/">
|
||||
<xsl:processing-instruction name="mso-application">progid="Excel.Sheet"</xsl:processing-instruction>
|
||||
<!-- Note: for debugging purpose include schema location
|
||||
<Workbook xsi:schemaLocation="urn:schemas-microsoft-com:office:spreadsheet <YOUR_SCHEMA_URL>/excelss.xsd"> -->
|
||||
<Workbook>
|
||||
<!-- adding some default settings -->
|
||||
<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
|
||||
<Colors>
|
||||
<xsl:for-each select="key('colors', /)
|
||||
[generate-id(.) =
|
||||
generate-id(key('colorRGB', .)[1]) and starts-with(., '#')] ">
|
||||
<xsl:sort select="." />
|
||||
<Color>
|
||||
<Index><xsl:value-of select="position() + 2" /></Index>
|
||||
<RGB><xsl:value-of select="." /></RGB>
|
||||
</Color>
|
||||
</xsl:for-each>
|
||||
<xsl:for-each select="key('config', 'TabColor')[not(.=preceding::config:config-item)]">
|
||||
<xsl:sort select="." />
|
||||
<Color>
|
||||
@@ -148,35 +143,35 @@
|
||||
</RGB>
|
||||
</Color>
|
||||
</xsl:for-each>
|
||||
</Colors>
|
||||
</OfficeDocumentSettings>
|
||||
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
|
||||
<xsl:if test="key('config', 'HasSheetTabs') = 'false'">
|
||||
<xsl:element name="HideWorkbookTabs" />
|
||||
</xsl:if>
|
||||
<WindowHeight>9000</WindowHeight>
|
||||
<WindowWidth>13860</WindowWidth>
|
||||
<WindowTopX>240</WindowTopX>
|
||||
<WindowTopY>75</WindowTopY>
|
||||
<ProtectStructure>False</ProtectStructure>
|
||||
<ProtectWindows>False</ProtectWindows>
|
||||
</ExcelWorkbook>
|
||||
<!-- Note: the following handling will exchange the default, later
|
||||
<x:ExcelWorkbook>
|
||||
<xsl:apply-templates select="table:calculation-settings" />
|
||||
</x:ExcelWorkbook>
|
||||
-->
|
||||
<xsl:element name="Styles">
|
||||
<!-- our application default will not be used for export to Excel
|
||||
<xsl:apply-templates select="/*/office:styles/style:default-style" mode="styles" />-->
|
||||
<xsl:apply-templates select="/*/office:styles/style:style" mode="styles" />
|
||||
<xsl:apply-templates select="/*/office:automatic-styles/style:style" mode="styles" >
|
||||
<xsl:with-param name="isAutomatic" select="true()" />
|
||||
</xsl:apply-templates>
|
||||
</xsl:element>
|
||||
<xsl:apply-templates select="/*/office:body" />
|
||||
</Workbook>
|
||||
</xsl:template>
|
||||
</Colors>
|
||||
</OfficeDocumentSettings>
|
||||
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
|
||||
<xsl:if test="key('config', 'HasSheetTabs') = 'false'">
|
||||
<xsl:element name="HideWorkbookTabs" />
|
||||
</xsl:if>
|
||||
<WindowHeight>9000</WindowHeight>
|
||||
<WindowWidth>13860</WindowWidth>
|
||||
<WindowTopX>240</WindowTopX>
|
||||
<WindowTopY>75</WindowTopY>
|
||||
<ProtectStructure>False</ProtectStructure>
|
||||
<ProtectWindows>False</ProtectWindows>
|
||||
</ExcelWorkbook>
|
||||
<!-- Note: the following handling will exchange the default, later
|
||||
<x:ExcelWorkbook>
|
||||
<xsl:apply-templates select="table:calculation-settings" />
|
||||
</x:ExcelWorkbook>
|
||||
-->
|
||||
<xsl:element name="Styles">
|
||||
<!-- our application default will not be used for export to Excel
|
||||
<xsl:apply-templates select="/*/office:styles/style:default-style" mode="styles" />-->
|
||||
<xsl:apply-templates select="/*/office:styles/style:style" mode="styles" />
|
||||
<xsl:apply-templates select="/*/office:automatic-styles/style:style" mode="styles" >
|
||||
<xsl:with-param name="isAutomatic" select="true()" />
|
||||
</xsl:apply-templates>
|
||||
</xsl:element>
|
||||
<xsl:apply-templates select="/*/office:body" />
|
||||
</Workbook>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="colordecimal2rgb">
|
||||
<xsl:param name="colordecimal"/>
|
||||
@@ -332,38 +327,38 @@
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
<xsl:template match="office:body">
|
||||
<!-- office:body table:table children are spreadsheets -->
|
||||
<xsl:apply-templates />
|
||||
</xsl:template>
|
||||
<xsl:template match="office:body">
|
||||
<!-- office:body table:table children are spreadsheets -->
|
||||
<xsl:apply-templates />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="office:spreadsheet">
|
||||
<xsl:apply-templates />
|
||||
</xsl:template>
|
||||
<xsl:template match="office:spreadsheet">
|
||||
<xsl:apply-templates />
|
||||
</xsl:template>
|
||||
|
||||
<!-- office:body table:table children are spreadsheets -->
|
||||
<xsl:template match="office:spreadsheet/table:table">
|
||||
<xsl:element name="ss:Worksheet">
|
||||
<xsl:variable name="TableName">
|
||||
<xsl:value-of select="@table:name" />
|
||||
</xsl:variable>
|
||||
<xsl:attribute name="ss:Name">
|
||||
<xsl:value-of select="$TableName" />
|
||||
</xsl:attribute>
|
||||
<xsl:call-template name="table:table" />
|
||||
<xsl:element name="x:WorksheetOptions">
|
||||
<xsl:if test="key('config', 'ShowGrid') = 'false'">
|
||||
<xsl:element name="x:DoNotDisplayGridlines" />
|
||||
</xsl:if>
|
||||
<xsl:if test="key('config', 'HasColumnRowHeaders') = 'false'">
|
||||
<xsl:element name="x:DoNotDisplayHeadings" />
|
||||
</xsl:if>
|
||||
<xsl:if test="key('config', 'IsOutlineSymbolsSet') = 'false'">
|
||||
<xsl:element name="x:DoNotDisplayOutline" />
|
||||
</xsl:if>
|
||||
<xsl:if test="key('config', 'ShowZeroValues') = 'false'">
|
||||
<xsl:element name="x:DoNotDisplayZeros" />
|
||||
</xsl:if>
|
||||
<!-- office:body table:table children are spreadsheets -->
|
||||
<xsl:template match="office:spreadsheet/table:table">
|
||||
<xsl:element name="ss:Worksheet">
|
||||
<xsl:variable name="TableName">
|
||||
<xsl:value-of select="@table:name" />
|
||||
</xsl:variable>
|
||||
<xsl:attribute name="ss:Name">
|
||||
<xsl:value-of select="$TableName" />
|
||||
</xsl:attribute>
|
||||
<xsl:call-template name="table:table" />
|
||||
<xsl:element name="x:WorksheetOptions">
|
||||
<xsl:if test="key('config', 'ShowGrid') = 'false'">
|
||||
<xsl:element name="x:DoNotDisplayGridlines" />
|
||||
</xsl:if>
|
||||
<xsl:if test="key('config', 'HasColumnRowHeaders') = 'false'">
|
||||
<xsl:element name="x:DoNotDisplayHeadings" />
|
||||
</xsl:if>
|
||||
<xsl:if test="key('config', 'IsOutlineSymbolsSet') = 'false'">
|
||||
<xsl:element name="x:DoNotDisplayOutline" />
|
||||
</xsl:if>
|
||||
<xsl:if test="key('config', 'ShowZeroValues') = 'false'">
|
||||
<xsl:element name="x:DoNotDisplayZeros" />
|
||||
</xsl:if>
|
||||
<xsl:if test="/*/office:settings/config:config-item-set/config:config-item-map-indexed/config:config-item-map-entry/config:config-item-map-named/config:config-item-map-entry[@config:name=$TableName]/config:config-item[@config:name='TabColor']">
|
||||
<xsl:element name="x:TabColorIndex">
|
||||
<xsl:variable name="TabColorIndex">
|
||||
@@ -374,40 +369,40 @@
|
||||
<xsl:value-of select="$TabColorIndex"/>
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="table:decls" mode="ExcelWorkbook">
|
||||
<xsl:apply-templates mode="ExcelWorkbook" />
|
||||
</xsl:template>
|
||||
<xsl:template match="table:decls" mode="ExcelWorkbook">
|
||||
<xsl:apply-templates mode="ExcelWorkbook" />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="table:calculation-settings" mode="ExcelWorkbook">
|
||||
<xsl:if test="table:precision-as-shown">
|
||||
<x:PrecisionAsDisplayed/>
|
||||
</xsl:if>
|
||||
<xsl:if test="table:null-date/@office:date-value='1904-01-01'">
|
||||
<x:Date1904/>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="table:iteration" />
|
||||
</xsl:template>
|
||||
<xsl:template match="table:calculation-settings" mode="ExcelWorkbook">
|
||||
<xsl:if test="table:precision-as-shown">
|
||||
<x:PrecisionAsDisplayed/>
|
||||
</xsl:if>
|
||||
<xsl:if test="table:null-date/@office:date-value='1904-01-01'">
|
||||
<x:Date1904/>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="table:iteration" />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="table:iteration" mode="ExcelWorkbook">
|
||||
<xsl:element name="x:ExcelWorkbook">
|
||||
<xsl:if test="@table:status = 'enable'">
|
||||
<x:Iteration/>
|
||||
</xsl:if>
|
||||
<xsl:if test="@table:steps">
|
||||
<xsl:element name="x:MaxIterations">
|
||||
<xsl:value-of select="@table:steps" />
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
<xsl:if test="@table:maximum-difference">
|
||||
<xsl:element name="x:MaxChange">
|
||||
<xsl:value-of select="@table:maximum-difference" />
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
<xsl:template match="table:iteration" mode="ExcelWorkbook">
|
||||
<xsl:element name="x:ExcelWorkbook">
|
||||
<xsl:if test="@table:status = 'enable'">
|
||||
<x:Iteration/>
|
||||
</xsl:if>
|
||||
<xsl:if test="@table:steps">
|
||||
<xsl:element name="x:MaxIterations">
|
||||
<xsl:value-of select="@table:steps" />
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
<xsl:if test="@table:maximum-difference">
|
||||
<xsl:element name="x:MaxChange">
|
||||
<xsl:value-of select="@table:maximum-difference" />
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,26 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
|
||||
<xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0" standalone="yes"/>
|
||||
<xsl:include href="../../common/measure_conversion.xsl"/>
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
|
||||
<!-- multiple usage: get size, type, color of table-cell, paragraph, and page borders. -->
|
||||
<xsl:template name="get-border-size">
|
||||
@@ -43,25 +38,25 @@
|
||||
<xsl:otherwise>none</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<!-- MS word and SO wirter borders Mapping
|
||||
MS word Borders SO borders
|
||||
w:val="single" w:sz="0" 0.05pt(0.002cm);solid
|
||||
w:val="single" w:sz="12" 1.00pt(0.035cm);solid
|
||||
w:val="single" w:sz="18" 2.50pt(0.088cm);solid
|
||||
w:val="single" w:sz="36" 4.00pt(0.141cm);solid
|
||||
w:val="single" w:sz="48" 5.00pt(0.176cm);solid
|
||||
w:val="double" w:sz="2" 1.10pt(0.039cm);double
|
||||
w:val="double" w:sz="6" 2.60pt(0.092cm);double
|
||||
w:val="thin-thick-small-gap" w:sz="12" 3.00pt(0.105cm);double
|
||||
w:val="thin-thick-large-gap" w:sz="18" 3.55pt(0.125cm);double
|
||||
w:val="thick-thin-medium-gap" w:sz="24" 4.50pt(0.158cm);double
|
||||
w:val="thin-thick-medium-gap" w:sz="24" 5.05pt(0.178cm);double
|
||||
w:val="thin-thick-small-gap" w:sz="24" 6.00pt(0.211cm);double
|
||||
w:val="thin-thick-medium-gap" w:sz="36 " 6.55pt(0.231cm);double
|
||||
w:val="double" w:sz="18" 7.50pt(0.264cm);double
|
||||
w:val="thin-thick-medium-gap" w:sz="48" 9.00pt(0.317cm);double;style:border-line-width="0.088cm 0.088cm 0.141cm"
|
||||
w:val="double" w:sz="24" 9.00pt(0.317cm);double;style:border-line-width="0.141cm 0.088cm 0.088cm"
|
||||
we adjust the criteria by adding about 1/2 range of this current criteria and next criteria. Gary. Yang -->
|
||||
<!-- MS word and SO writer borders Mapping
|
||||
MS word Borders SO borders
|
||||
w:val="single" w:sz="0" 0.05pt(0.002cm);solid
|
||||
w:val="single" w:sz="12" 1.00pt(0.035cm);solid
|
||||
w:val="single" w:sz="18" 2.50pt(0.088cm);solid
|
||||
w:val="single" w:sz="36" 4.00pt(0.141cm);solid
|
||||
w:val="single" w:sz="48" 5.00pt(0.176cm);solid
|
||||
w:val="double" w:sz="2" 1.10pt(0.039cm);double
|
||||
w:val="double" w:sz="6" 2.60pt(0.092cm);double
|
||||
w:val="thin-thick-small-gap" w:sz="12" 3.00pt(0.105cm);double
|
||||
w:val="thin-thick-large-gap" w:sz="18" 3.55pt(0.125cm);double
|
||||
w:val="thick-thin-medium-gap" w:sz="24" 4.50pt(0.158cm);double
|
||||
w:val="thin-thick-medium-gap" w:sz="24" 5.05pt(0.178cm);double
|
||||
w:val="thin-thick-small-gap" w:sz="24" 6.00pt(0.211cm);double
|
||||
w:val="thin-thick-medium-gap" w:sz="36" 6.55pt(0.231cm);double
|
||||
w:val="double" w:sz="18" 7.50pt(0.264cm);double
|
||||
w:val="thin-thick-medium-gap" w:sz="48" 9.00pt(0.317cm);double;style:border-line-width="0.088cm 0.088cm 0.141cm"
|
||||
w:val="double" w:sz="24" 9.00pt(0.317cm);double;style:border-line-width="0.141cm 0.088cm 0.088cm"
|
||||
we adjust the criteria by adding about 1/2 range of this current criteria and next criteria. Gary. Yang -->
|
||||
<xsl:variable name="microsoft-border-style-size">
|
||||
<xsl:choose>
|
||||
<xsl:when test=" $border-style = 'solid'">
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
|
||||
<xsl:template name="ooo_custom_draw2ms_word_draw_map">
|
||||
<xsl:param name="ooo_predefined_type"/>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,26 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
|
||||
<!-- the following are common used fields -->
|
||||
<xsl:template match="text:page-number | text:page-count | text:subject | text:initial-creator | text:title | text:date
|
||||
@@ -200,7 +195,7 @@
|
||||
<!--wx:font wx:val="MS Mincho"/ -->
|
||||
<w:lang w:fareast="JA"/>
|
||||
</xsl:when>
|
||||
<xsl:when test=" @style:num-format ='壹, 貳, 參, ...' or @style:num-format ='壹, 貳, 參, ...' or @style:num-format ='壹, 贰, 叁, ...'or @style:num-format = '一, 二, 三, ...' ">
|
||||
<xsl:when test=" @style:num-format ='壹, 貳, 參, ...' or @style:num-format ='壹, 貳, 參, ...' or @style:num-format ='壹, 贰, 叁, ...'or @style:num-format = '一, 二, 三, ...' ">
|
||||
<w:rFonts w:hint="fareast"/>
|
||||
<!--wx:font wx:val="宋体"/ -->
|
||||
</xsl:when>
|
||||
@@ -217,7 +212,7 @@
|
||||
<!-- this template get the various of number formats for number type field-->
|
||||
<xsl:param name="field_number_format_style"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test=" $field_number_format_style = '1, 2, 3, ...' or $field_number_format_style = '1' ">
|
||||
<xsl:when test=" $field_number_format_style = '1, 2, 3, ...' or $field_number_format_style = '1' ">
|
||||
<xsl:text> \* Arabic </xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$field_number_format_style = '①, ②, ③, ...' ">
|
||||
@@ -232,8 +227,7 @@
|
||||
<xsl:when test="$field_number_format_style = '一, 二, 三, ...'">
|
||||
<xsl:text> \* CHINESENUM3 </xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test=" $field_number_format_style ='壹, 貳, 參, ...' or $field_number_format_style ='壹, 貳, 參, ...' or
|
||||
$field_number_format_style ='壹, 贰, 叁, ...' ">
|
||||
<xsl:when test=" $field_number_format_style ='壹, 貳, 參, ...' or $field_number_format_style ='壹, 貳, 參, ...' or $field_number_format_style ='壹, 贰, 叁, ...' ">
|
||||
<xsl:text> \* CHINESENUM2 </xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$field_number_format_style = '壱, 弐, 参, ...' ">
|
||||
@@ -269,6 +263,9 @@ $field_number_format_style ='壹, 贰, 叁, ...' ">
|
||||
<xsl:when test="$field_number_format_style ='A' ">
|
||||
<xsl:text> \* ALPHABETIC </xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$field_number_format_style = 'א, י, ק, ...' ">
|
||||
<xsl:text> \* hebrew1 </xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$field_number_format_style = 'א, ב, ג, ...' ">
|
||||
<xsl:text> \* hebrew2 </xsl:text>
|
||||
</xsl:when>
|
||||
@@ -286,13 +283,13 @@ $field_number_format_style ='壹, 贰, 叁, ...' ">
|
||||
<xsl:template name="field_get_date_format">
|
||||
<xsl:param name="field_date_stylename"/>
|
||||
<xsl:param name="field_date_value"/>
|
||||
<!-- this template retun null date format ATM-->
|
||||
<!-- this template return null date format ATM-->
|
||||
<xsl:text/>
|
||||
</xsl:template>
|
||||
<xsl:template name="field_get_time_format">
|
||||
<xsl:param name="field_time_stylename"/>
|
||||
<xsl:param name="field_time_value"/>
|
||||
<!-- this template retun null date format ATM-->
|
||||
<!-- this template return null date format ATM-->
|
||||
<xsl:text/>
|
||||
</xsl:template>
|
||||
<xsl:template match="text:template-name">
|
||||
@@ -359,7 +356,7 @@ $field_number_format_style ='壹, 贰, 叁, ...' ">
|
||||
</w:fldSimple>
|
||||
</xsl:template>
|
||||
<xsl:template name="field_convert_linebreak">
|
||||
<!-- this template convert the linebreak (
 and 
) in continous text to Ms word element<w:br/> -->
|
||||
<!-- this template convert the linebreak (
 and 
) in continuous text to Ms word element<w:br/> -->
|
||||
<xsl:param name="field_input_text"/>
|
||||
<xsl:if test="not (contains($field_input_text,'
'))">
|
||||
<w:t>
|
||||
@@ -512,7 +509,7 @@ $field_number_format_style ='壹, 贰, 叁, ...' ">
|
||||
<xsl:call-template name="export_hyoerlink"/>
|
||||
</xsl:template>
|
||||
<xsl:template name="export_hyoerlink">
|
||||
<!-- all params are useed by draw -->
|
||||
<!-- all params are used by draw -->
|
||||
<xsl:param name="TargetMeasure"/>
|
||||
<xsl:param name="x-adjust"/>
|
||||
<xsl:param name="y-adjust"/>
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
|
||||
<xsl:template name="ListStyles">
|
||||
<w:lists>
|
||||
@@ -219,7 +214,7 @@
|
||||
<xsl:param name="number-format"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$number-format = 'a'">
|
||||
<!-- nfcLCLetter: Lowercase alpah -->
|
||||
<!-- nfcLCLetter: Lowercase alpha -->
|
||||
<w:nfc w:val="4"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = 'A'">
|
||||
@@ -234,6 +229,18 @@
|
||||
<!-- nfcUCRoman: Uppercase roman -->
|
||||
<w:nfc w:val="1"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = '1st'">
|
||||
<!-- nfcUCOrdinal: Ordinal indicator -->
|
||||
<w:nfc w:val="5"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = 'One'">
|
||||
<!-- nfcCardText: Cardinal -->
|
||||
<w:nfc w:val="6"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = 'First'">
|
||||
<!-- nfcOrdText: Ordinal -->
|
||||
<w:nfc w:val="7"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = '1, 2, 3, ...'">
|
||||
<!-- '1, 2, 3, ...' also seems: decimal-full-width2 -->
|
||||
<w:nfc w:val="14"/>
|
||||
@@ -278,25 +285,29 @@
|
||||
<w:nfc w:val="41"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = 'ㄱ, ㄴ, ㄷ, ...' or $number-format = '㉠, ㉡, ㉢, ...'">
|
||||
<!-- mapping circled to uncirled -->
|
||||
<!-- mapping circled to uncircled -->
|
||||
<w:nfc w:val="25"/>
|
||||
</xsl:when>
|
||||
<xsl:when test='$number-format = "가, 나, 다, ..." or $number-format = "㉮, ㉯, ㉰, ..."'>
|
||||
<!-- mapping circled to uncirled -->
|
||||
<!-- mapping circled to uncircled -->
|
||||
<w:nfc w:val="24"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format ='أ, ب, ت, ...'">
|
||||
<!-- 46. hebrew-1-->
|
||||
<!-- 46. arabic-alpha-->
|
||||
<w:nfc w:val="46"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = 'ก, ข, ฃ, ...'">
|
||||
<!--53. thai-letters not match well !-->
|
||||
<!--53. thai-letters not match well !-->
|
||||
<w:nfc w:val="53"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format='א, ב, ג, ...'">
|
||||
<!--45. arabic-alpha-->
|
||||
<xsl:when test="$number-format='א, י, ק, ...'">
|
||||
<!--45. hebrew-1-->
|
||||
<w:nfc w:val="45"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format='א, ב, ג, ...'">
|
||||
<!--47. hebrew-2-->
|
||||
<w:nfc w:val="47"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="string-length($number-format)=0">
|
||||
<w:nfc w:val="255"/>
|
||||
</xsl:when>
|
||||
@@ -329,7 +340,7 @@
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<!-- unsupported: ordinal, cardinal-text, ordinal-text, hex, chicago, bullet, ideograph-zodiac-traditional,
|
||||
<!-- unsupported: hex, chicago, bullet, ideograph-zodiac-traditional,
|
||||
chinese-not-impl, korean-legal, none -->
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
|
||||
<xsl:template name="page-background">
|
||||
<xsl:choose>
|
||||
@@ -41,7 +36,7 @@
|
||||
<w:binData w:name="{$binName}">
|
||||
<xsl:value-of select="translate(office:binary-data/text(),'	  ','' ) "/>
|
||||
</w:binData>
|
||||
<w:background w:bgcolor="{parent::style:page-layout-propertie/@fo:background-color}" w:background="{$binName}"/>
|
||||
<w:background w:bgcolor="{parent::style:page-layout-properties/@fo:background-color}" w:background="{$binName}"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="style:page-layout-properties" mode="bgPict">
|
||||
<w:background w:bgcolor="{@fo:background-color}"/>
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
|
||||
<xsl:include href="../../common/math.xsl"/>
|
||||
<xsl:template name="test-arc">
|
||||
@@ -424,7 +419,7 @@
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<xsl:template name="get-number-before">
|
||||
<!-- get $count number of number before current position , output format:number1 number2 ... numberN:newpostion
|
||||
<!-- get $count number of number before current position , output format:number1 number2 ... numberN:newposition
|
||||
skip $skipcount of numbers
|
||||
-->
|
||||
<xsl:param name="svg-path"/>
|
||||
@@ -478,7 +473,7 @@
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<xsl:template name="get-number-after">
|
||||
<!-- get $count number of number after current position, output format:number1 number2 ... numberN:newpostion
|
||||
<!-- get $count number of number after current position, output format:number1 number2 ... numberN:newposition
|
||||
skip $skipcount of numbers
|
||||
-->
|
||||
<xsl:param name="svg-path"/>
|
||||
@@ -628,7 +623,7 @@
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="string-length(translate($curr-char , '+-' ,'') ) = 0 and string-length($number) > 0">
|
||||
<!-- finsh it with +/- -->
|
||||
<!-- finish it with +/- -->
|
||||
<xsl:value-of select="concat( round( concat( $curr-char, $number)) , ':' , $position)"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
@@ -648,7 +643,7 @@
|
||||
<xsl:variable name="curr-char" select="substring($svg-path, $position , 1)"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(translate($curr-char , 'MmZzLlHhVvCcSsQqTtAa' ,'')) = 0 ">
|
||||
<!-- "MmZzLlHhVvCcSsQqTtAa" are all possiable command chars -->
|
||||
<!-- "MmZzLlHhVvCcSsQqTtAa" are all possible command chars -->
|
||||
<xsl:value-of select="concat( $curr-char , ':' , $position +1)"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="string-length(translate($curr-char , '+-.0123456789' ,'')) = 0 ">
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
|
||||
<xsl:template match="office:settings">
|
||||
<w:docPr>
|
||||
@@ -253,11 +248,11 @@
|
||||
<w:numFmt w:val="korean-digital"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = 'ㄱ, ㄴ, ㄷ, ...' or $number-format = '㉠, ㉡, ㉢, ...'">
|
||||
<!-- mapping circled to uncirled -->
|
||||
<!-- mapping circled to uncircled -->
|
||||
<w:numFmt w:val="chosung"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = '가, 나, 다, ...' or $number-format = '㉮, ㉯, ㉰, ...'">
|
||||
<!-- mapping circled to uncirled -->
|
||||
<!-- mapping circled to uncircled -->
|
||||
<w:numFmt w:val="ganada"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = 'أ, ب, ت, ...'">
|
||||
@@ -266,9 +261,12 @@
|
||||
<xsl:when test="$number-format = 'ก, ข, ฃ, ...'">
|
||||
<w:numFmt w:val="thai-letters"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = 'א, ב, ג, ...'">
|
||||
<xsl:when test="$number-format = 'א, י, ק, ...'">
|
||||
<w:numFmt w:val="hebrew-1"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = 'א, ב, ג, ...'">
|
||||
<w:numFmt w:val="hebrew-2"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$number-format = 'Native Numbering'">
|
||||
<xsl:variable name="locale" select="/office:document/office:meta/dc:language"/>
|
||||
<xsl:choose>
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
|
||||
<xsl:key name="table-style" match="style:style[@style:family='table']" use="@style:name"/>
|
||||
<xsl:key name="table-column-style" match="style:style[@style:family='table-column']" use="@style:name"/>
|
||||
@@ -103,7 +98,7 @@
|
||||
<xsl:if test="@table:is-sub-table ='true' ">
|
||||
<w:tblW w:type="dxa">
|
||||
<xsl:variable name="sub-table-width">
|
||||
<xsl:call-template name="caculate-sub-table-width">
|
||||
<xsl:call-template name="calculate-sub-table-width">
|
||||
<xsl:with-param name="sub-table-column-node" select="table:table-column[1]"/>
|
||||
<xsl:with-param name="total-sub-table-width" select="0"/>
|
||||
</xsl:call-template>
|
||||
@@ -142,7 +137,7 @@
|
||||
<w:p/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<xsl:template name="caculate-sub-table-width">
|
||||
<xsl:template name="calculate-sub-table-width">
|
||||
<xsl:param name="sub-table-column-node"/>
|
||||
<xsl:param name="total-sub-table-width"/>
|
||||
<xsl:variable name="column-width" select="key('table-column-style', $sub-table-column-node/@table:style-name)/style:table-column-properties/@style:column-width"/>
|
||||
@@ -155,13 +150,13 @@
|
||||
<xsl:when test="$sub-table-column-node/following-sibling::table:table-column">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$sub-table-column-node/@table:number-columns-repeated">
|
||||
<xsl:call-template name="caculate-sub-table-width">
|
||||
<xsl:call-template name="calculate-sub-table-width">
|
||||
<xsl:with-param name="sub-table-column-node" select="$sub-table-column-node/following-sibling::table:table-column[ 1]"/>
|
||||
<xsl:with-param name="total-sub-table-width" select="$total-sub-table-width + $column-width-in-twip * $sub-table-column-node/@table:number-columns-repeated"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="caculate-sub-table-width">
|
||||
<xsl:call-template name="calculate-sub-table-width">
|
||||
<xsl:with-param name="sub-table-column-node" select="$sub-table-column-node/following-sibling::table:table-column[1]"/>
|
||||
<xsl:with-param name="total-sub-table-width" select="$total-sub-table-width + $column-width-in-twip "/>
|
||||
</xsl:call-template>
|
||||
@@ -189,7 +184,7 @@
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<!-- if table:table-column has attribute table:number-columns-repeated, then call the recursion
|
||||
temple repeat-gridcol to produce multiple w:gridCol in MS word. Gary.Yang -->
|
||||
temple repeat-gridcol to produce multiple w:gridCol in MS word. Gary.Yang -->
|
||||
<xsl:when test="@table:number-columns-repeated">
|
||||
<xsl:call-template name="repeat-gridcol">
|
||||
<xsl:with-param name="grid-repeat-count" select="@table:number-columns-repeated"/>
|
||||
@@ -234,12 +229,12 @@
|
||||
<xsl:template match="table:table-cell ">
|
||||
<xsl:element name="w:tc">
|
||||
<xsl:element name="w:tcPr">
|
||||
<!-- to caclate the table-cell width Gary.Yang -->
|
||||
<!-- to calculate the table-cell width Gary.Yang -->
|
||||
<xsl:choose>
|
||||
<!--when the table-cell contains the sub-table -->
|
||||
<!--when the table-cell contains the sub-table -->
|
||||
<xsl:when test="table:table/@table:is-sub-table= 'true' ">
|
||||
<xsl:variable name="table-cell-width">
|
||||
<xsl:call-template name="caculate-sub-table-width">
|
||||
<xsl:call-template name="calculate-sub-table-width">
|
||||
<xsl:with-param name="sub-table-column-node" select="table:table/table:table-column[1]"/>
|
||||
<xsl:with-param name="total-sub-table-width" select="0"/>
|
||||
</xsl:call-template>
|
||||
@@ -251,7 +246,7 @@
|
||||
<xsl:otherwise>
|
||||
<!-- when the table-cell doesn't contain the sub-table -->
|
||||
<xsl:variable name="table-cell-width">
|
||||
<xsl:call-template name="caculate-table-cell-width">
|
||||
<xsl:call-template name="calculate-table-cell-width">
|
||||
<xsl:with-param name="table-cell-position" select="position()"/>
|
||||
<xsl:with-param name="table-column" select="ancestor::table:table[1]/table:table-column[1]"/>
|
||||
</xsl:call-template>
|
||||
@@ -305,7 +300,7 @@
|
||||
</w:right>
|
||||
</xsl:if>
|
||||
</w:tcMar>
|
||||
<!-- the following code is to get the cell borders if they exsits Gary.Yang-->
|
||||
<!-- the following code is to get the cell borders if they exist -->
|
||||
<xsl:variable name="border-top" select="$cell-style-properties/@fo:border-top | $cell-style-properties/@fo:border"/>
|
||||
<xsl:variable name="border-bottom" select="$cell-style-properties/@fo:border-bottom | $cell-style-properties/@fo:border"/>
|
||||
<xsl:variable name="border-left" select="$cell-style-properties/@fo:border-left | $cell-style-properties/@fo:border"/>
|
||||
@@ -359,7 +354,7 @@
|
||||
<xsl:apply-templates select=" text:p | table:table | text:h | office:annotation"/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
<xsl:template name="caculate-table-cell-width">
|
||||
<xsl:template name="calculate-table-cell-width">
|
||||
<xsl:param name="table-cell-position"/>
|
||||
<xsl:param name="table-column"/>
|
||||
<xsl:choose>
|
||||
@@ -375,7 +370,7 @@
|
||||
<xsl:value-of select="$table-cell-width-in-twip"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="caculate-table-cell-width">
|
||||
<xsl:call-template name="calculate-table-cell-width">
|
||||
<xsl:with-param name="table-cell-position" select="$table-cell-position - $table-column/@table:number-columns-repeated"/>
|
||||
<xsl:with-param name="table-column" select="$table-column/following-sibling::table:table-column[1]"/>
|
||||
</xsl:call-template>
|
||||
@@ -395,14 +390,14 @@
|
||||
<xsl:value-of select="$table-cell-width-in-twip"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="($table-cell-position - 1) > 0">
|
||||
<xsl:call-template name="caculate-table-cell-width">
|
||||
<xsl:call-template name="calculate-table-cell-width">
|
||||
<xsl:with-param name="table-cell-position" select=" $table-cell-position - 1 "/>
|
||||
<xsl:with-param name="table-column" select="$table-column/following-sibling::table:table-column[1]"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:message>
|
||||
<xsl:value-of select=" 'caculate table cell width wrong ' "/>
|
||||
<xsl:value-of select=" 'calculate table cell width wrong ' "/>
|
||||
</xsl:message>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
|
||||
<xsl:template match="style:paragraph-properties" mode="paragraph">
|
||||
<w:pPr>
|
||||
@@ -360,7 +355,7 @@
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
<xsl:if test="@text:number-lines='false'">
|
||||
<w:supressLineNumbers/>
|
||||
<w:suppressLineNumbers/>
|
||||
</xsl:if>
|
||||
<xsl:variable name="border-top" select="@fo:border-top | @fo:border"/>
|
||||
<xsl:variable name="border-bottom" select="@fo:border-bottom | @fo:border"/>
|
||||
@@ -792,7 +787,7 @@
|
||||
<xsl:variable name="following-section" select="following::text:section[1]"/>
|
||||
<xsl:variable name="ancestor-section" select="ancestor::text:section"/>
|
||||
<!-- if the following neighbour paragraph/heading are slave of one master style, or new section starts,
|
||||
then a new page will start -->
|
||||
then a new page will start -->
|
||||
<xsl:variable name="next-is-new-page" select="boolean(key( 'slave-style', $following-paragraph-heading-table[1]/@*[name()='text:style-name' or name()='table:style-name']))"/>
|
||||
<xsl:variable name="next-is-new-section">
|
||||
<xsl:if test="$following-section and generate-id($following-section/descendant::*[(name()= 'text:p' or name()= 'text:h' or name()= 'table:table') and position() =1]) = generate-id($following-paragraph-heading-table[1])">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,179 +1,174 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<!--
|
||||
For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
|
||||
-->
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:xforms="http://www.w3.org/2002/xforms"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi xforms xsd xsi"
|
||||
xmlns="http://www.w3.org/1999/xhtml">
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:xforms="http://www.w3.org/2002/xforms"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi xforms xsd xsi"
|
||||
xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
|
||||
<!--+++++ INCLUDED XSL MODULES +++++-->
|
||||
<!--+++++ INCLUDED XSL MODULES +++++-->
|
||||
|
||||
<!-- inheritance of office style properties is resolved into absolute styles. Office properties gathered as elements -->
|
||||
<xsl:include href="../common/styles/style_collector.xsl" />
|
||||
<!-- inheritance of office style properties is resolved into absolute styles. Office properties gathered as elements -->
|
||||
<xsl:include href="../common/styles/style_collector.xsl" />
|
||||
|
||||
<!-- mapping rules of office style properties to CSS/HTML properties -->
|
||||
<xsl:include href="../common/styles/style_mapping_css.xsl" />
|
||||
<!-- mapping rules of office style properties to CSS/HTML properties -->
|
||||
<xsl:include href="../common/styles/style_mapping_css.xsl" />
|
||||
|
||||
<!-- office header element handling especially for XHTML -->
|
||||
<xsl:include href="header.xsl" />
|
||||
<!-- office header element handling especially for XHTML -->
|
||||
<xsl:include href="header.xsl" />
|
||||
|
||||
<!-- office body element handling especially for XHTML -->
|
||||
<xsl:include href="body.xsl" />
|
||||
<!-- office body element handling especially for XHTML -->
|
||||
<xsl:include href="body.xsl" />
|
||||
|
||||
|
||||
<xsl:output method = "xml"
|
||||
encoding = "UTF-8"
|
||||
media-type = "application/xhtml+xml"
|
||||
indent = "no"
|
||||
omit-xml-declaration = "no"
|
||||
doctype-public = "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
|
||||
doctype-system = "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd" />
|
||||
<xsl:output method = "xml"
|
||||
encoding = "UTF-8"
|
||||
media-type = "application/xhtml+xml"
|
||||
indent = "no"
|
||||
omit-xml-declaration = "no"
|
||||
doctype-public = "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
|
||||
doctype-system = "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd" />
|
||||
|
||||
|
||||
|
||||
<xsl:variable name="namespace" select="'http://www.w3.org/1999/xhtml'" />
|
||||
<xsl:variable name="namespace" select="'http://www.w3.org/1999/xhtml'" />
|
||||
|
||||
<!--+++++ PARAMETER SECTION +++++-->
|
||||
<!--+++++ PARAMETER SECTION +++++-->
|
||||
|
||||
<!-- OPTIONAL: if the document content is provided in a directory structure. Opposite to a single flat XML stream -->
|
||||
<xsl:param name="isPackageFormat" />
|
||||
<!-- OPTIONAL: if the document content is provided in a directory structure. Opposite to a single flat XML stream -->
|
||||
<xsl:param name="isPackageFormat" />
|
||||
|
||||
<!-- OPTIONAL: (MANDATORY: for all input document with relative external links): parameter is a absolute file URL to the target directory.
|
||||
Relative links from the office document (e.g. to external graphics) will get this parameter as a prefix -->
|
||||
<xsl:param name="targetBaseURL" select="'./'" />
|
||||
<!-- OPTIONAL: (MANDATORY: for all input document with relative external links): parameter is an absolute file URL to the target directory.
|
||||
Relative links from the office document (e.g. to external graphics) will get this parameter as a prefix -->
|
||||
<xsl:param name="targetBaseURL" select="'./'" />
|
||||
|
||||
<!-- OPTIONAL: (MANDATORY: for all input document with content table) : parameter is a absolute file URL to the target document.
|
||||
Relative links to this office document (e.g. to internal anchor) will get this parameter as a prefix -->
|
||||
<xsl:param name="targetURL" select="'./'" />
|
||||
<!-- OPTIONAL: (MANDATORY: for all input document with content table) : parameter is an absolute file URL to the target document.
|
||||
Relative links to this office document (e.g. to internal anchor) will get this parameter as a prefix -->
|
||||
<xsl:param name="targetURL" select="'./'" />
|
||||
|
||||
<!-- OPTIONAL: (MANDATORY: for input document with relative internal links)
|
||||
To access contents of a office file (content like the meta.xml, styles.xml file or graphics) a URL could be choosen.
|
||||
This could be even a JAR URL. The sourceBase of the content URL "jar:file:/C:/temp/Test.sxw!/content.xml" would be
|
||||
"jar:file:/C:/temp/Test.sxw!/" for example.
|
||||
When working with OpenOffice API a Package-URL encoded over HTTP can be used to access the jared contents of the the jared document. -->
|
||||
<xsl:param name="sourceBaseURL" select="'./'" />
|
||||
<!-- OPTIONAL: (MANDATORY: for input document with relative internal links)
|
||||
To access contents of an office file (content like the meta.xml, styles.xml file or graphics) a URL could be chosen.
|
||||
This could be even a JAR URL. The sourceBase of the content URL "jar:file:/C:/temp/Test.sxw!/content.xml" would be
|
||||
"jar:file:/C:/temp/Test.sxw!/" for example.
|
||||
When working with OpenOffice API a Package-URL encoded over HTTP can be used to access the jared contents of the jared document. -->
|
||||
<xsl:param name="sourceBaseURL" select="'./'" />
|
||||
|
||||
<!-- OPTIONAL: (MANDATORY: for session management by URL rewriting)
|
||||
Useful for WebApplications: if a HTTP session is not cookie based, URL rewriting is beeing used (the session is appended to the URL).
|
||||
This URL session is used for example when links to graphics are created by XSLT. Otherwise the user havt to log again in for every graphic he liks to see. -->
|
||||
<xsl:param name="optionalURLSuffix" />
|
||||
<!-- OPTIONAL: (MANDATORY: for session management by URL rewriting)
|
||||
Useful for WebApplications: if a HTTP session is not cookie based, URL rewriting is being used (the session is appended to the URL).
|
||||
This URL session is used for example when links to graphics are created by XSLT. Otherwise the user have to log again in for every graphic he likes to see. -->
|
||||
<xsl:param name="optionalURLSuffix" />
|
||||
|
||||
<!-- OPTIONAL: URL to office meta file (flat xml use the URL to the input file) -->
|
||||
<xsl:param name="metaFileURL" />
|
||||
<!-- OPTIONAL: URL to office meta file (flat xml use the URL to the input file) -->
|
||||
<xsl:param name="metaFileURL" />
|
||||
|
||||
<!-- OPTIONAL: URL to office meta file (flat xml use the URL to the input file) -->
|
||||
<xsl:param name="stylesFileURL" />
|
||||
<!-- OPTIONAL: URL to office meta file (flat xml use the URL to the input file) -->
|
||||
<xsl:param name="stylesFileURL" />
|
||||
|
||||
<!-- OPTIONAL: DPI (dots per inch) the standard resolution of given pictures (necessary for the conversion of 'cm' into 'pixel')-->
|
||||
<!-- Although many pictures have a 96 dpi resolution, a higher resoltion give better results for common browsers -->
|
||||
<!-- Cp. measure_conversion.xsl:
|
||||
<xsl:param name="dpi" select="111" /> -->
|
||||
<!-- OPTIONAL: DPI (dots per inch) the standard resolution of given pictures (necessary for the conversion of 'cm' into 'pixel')-->
|
||||
<!-- Although many pictures have a 96 dpi resolution, a higher resolution give better results for common browsers -->
|
||||
<!-- Cp. measure_conversion.xsl:
|
||||
<xsl:param name="dpi" select="111" /> -->
|
||||
|
||||
|
||||
<!-- OPTIONAL: in case of using a different processor than a JAVA XSLT, you can unable the Java functionality
|
||||
(e.g. encoding chapter names for the content-table as href and anchors ) -->
|
||||
<xsl:param name="java" select="true()" />
|
||||
<xsl:param name="javaEnabled" select="boolean($java)" />
|
||||
<!-- OPTIONAL: in case of using a different processor than a JAVA XSLT, you can unable the Java functionality
|
||||
(e.g. encoding chapter names for the content-table as href and anchors ) -->
|
||||
<xsl:param name="java" select="true()" />
|
||||
<xsl:param name="javaEnabled" select="boolean($java)" />
|
||||
|
||||
<!-- OPTIONAL: for activating the debug mode set the variable here to 'true()' or give any value from outside -->
|
||||
<xsl:param name="debug" select="false()" />
|
||||
<xsl:param name="debugEnabled" select="boolean($debug)" />
|
||||
<xsl:param name="onlyStyleOutput" select="false()" />
|
||||
<xsl:param name="onlyStyleOutputEnabled" select="boolean($onlyStyleOutput)" />
|
||||
<!-- OPTIONAL: for activating the debug mode set the variable here to 'true()' or give any value from outside -->
|
||||
<xsl:param name="debug" select="false()" />
|
||||
<xsl:param name="debugEnabled" select="boolean($debug)" />
|
||||
<xsl:param name="onlyStyleOutput" select="false()" />
|
||||
<xsl:param name="onlyStyleOutputEnabled" select="boolean($onlyStyleOutput)" />
|
||||
|
||||
<!-- ************************************* -->
|
||||
<!-- *** build the propriate HTML file *** -->
|
||||
<!-- ************************************* -->
|
||||
<xsl:template match="/">
|
||||
<!-- debug output of parameter value set -->
|
||||
<xsl:if test="$debugEnabled">
|
||||
<xsl:call-template name="debug-check-paramter" />
|
||||
</xsl:if>
|
||||
<!-- gathers style properties and
|
||||
returns them as globalData parameter to the 'start-main' template -->
|
||||
<xsl:call-template name="collect-global-odf-properties" />
|
||||
</xsl:template>
|
||||
<!-- *************************************** -->
|
||||
<!-- *** build the appropriate HTML file *** -->
|
||||
<!-- *************************************** -->
|
||||
<xsl:template match="/">
|
||||
<!-- debug output of parameter value set -->
|
||||
<xsl:if test="$debugEnabled">
|
||||
<xsl:call-template name="debug-check-parameter" />
|
||||
</xsl:if>
|
||||
<!-- gathers style properties and
|
||||
returns them as globalData parameter to the 'start-main' template -->
|
||||
<xsl:call-template name="collect-global-odf-properties" />
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- *************************** -->
|
||||
<!-- *** Built up XHTML file *** -->
|
||||
<!-- *************************** -->
|
||||
<xsl:template name="start-main">
|
||||
<xsl:param name="globalData" />
|
||||
<!-- *************************** -->
|
||||
<!-- *** Built up XHTML file *** -->
|
||||
<!-- *************************** -->
|
||||
<xsl:template name="start-main">
|
||||
<xsl:param name="globalData" />
|
||||
|
||||
<xsl:element name="html">
|
||||
<xsl:comment>This file was converted to xhtml by OpenOffice.org - see http://xml.openoffice.org/odf2xhtml for more info.</xsl:comment>
|
||||
<xsl:call-template name='create-header'>
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
<xsl:element name="html">
|
||||
<xsl:comment>This file was converted to xhtml by LibreOffice - see https://cgit.freedesktop.org/libreoffice/core/tree/filter/source/xslt for the code.</xsl:comment>
|
||||
<xsl:call-template name='create-header'>
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name='create-body'>
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
<xsl:call-template name='create-body'>
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- debug purpose only:
|
||||
verbose checking of the parameters of this template-->
|
||||
<xsl:template name="debug-check-paramter">
|
||||
<xsl:message>Parameter dpi: <xsl:value-of select="$dpi" /></xsl:message>
|
||||
<xsl:message>Parameter metaFileURL: <xsl:value-of select="$metaFileURL" /></xsl:message>
|
||||
<xsl:message>Parameter stylesFileURL: <xsl:value-of select="$stylesFileURL" /></xsl:message>
|
||||
<xsl:message>Parameter sourceBaseURL: <xsl:value-of select="$sourceBaseURL" /></xsl:message>
|
||||
<xsl:message>Parameter targetBaseURL: <xsl:value-of select="$targetBaseURL" /></xsl:message>
|
||||
<xsl:message>Parameter onlyStyleOutputEnabled: <xsl:value-of select="$onlyStyleOutputEnabled" /></xsl:message>
|
||||
<xsl:message>Parameter debugEnabled: <xsl:value-of select="$debugEnabled" /></xsl:message>
|
||||
<xsl:message>Parameter java: <xsl:value-of select="$java" /></xsl:message>
|
||||
<xsl:message>Parameter javaEnabled: <xsl:value-of select="$javaEnabled" /></xsl:message>
|
||||
</xsl:template>
|
||||
<!-- debug purpose only:
|
||||
verbose checking of the parameters of this template-->
|
||||
<xsl:template name="debug-check-parameter">
|
||||
<xsl:message>Parameter dpi: <xsl:value-of select="$dpi" /></xsl:message>
|
||||
<xsl:message>Parameter metaFileURL: <xsl:value-of select="$metaFileURL" /></xsl:message>
|
||||
<xsl:message>Parameter stylesFileURL: <xsl:value-of select="$stylesFileURL" /></xsl:message>
|
||||
<xsl:message>Parameter sourceBaseURL: <xsl:value-of select="$sourceBaseURL" /></xsl:message>
|
||||
<xsl:message>Parameter targetBaseURL: <xsl:value-of select="$targetBaseURL" /></xsl:message>
|
||||
<xsl:message>Parameter onlyStyleOutputEnabled: <xsl:value-of select="$onlyStyleOutputEnabled" /></xsl:message>
|
||||
<xsl:message>Parameter debugEnabled: <xsl:value-of select="$debugEnabled" /></xsl:message>
|
||||
<xsl:message>Parameter java: <xsl:value-of select="$java" /></xsl:message>
|
||||
<xsl:message>Parameter javaEnabled: <xsl:value-of select="$javaEnabled" /></xsl:message>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
@@ -1,218 +1,213 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
|
||||
|
||||
<!--
|
||||
For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<!--
|
||||
For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
|
||||
-->
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:xforms="http://www.w3.org/2002/xforms"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi"
|
||||
xmlns="http://www.w3.org/1999/xhtml">
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:xforms="http://www.w3.org/2002/xforms"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi"
|
||||
xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
|
||||
|
||||
<!-- current node is a table:table -->
|
||||
<xsl:template name="create-table-children">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allVisibleTableRows" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
<!-- current node is a table:table -->
|
||||
<xsl:template name="create-table-children">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allVisibleTableRows" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
|
||||
<xsl:element name="colgroup">
|
||||
<xsl:for-each select="$allTableColumns/table:table-column">
|
||||
<xsl:if test="not(@table:visibility = 'collapse' or @table:visibility = 'filter')">
|
||||
<xsl:element name="col">
|
||||
<xsl:variable name="value" select="$globalData/all-doc-styles/style[@style:name = current()/@table:style-name]/*/@style:column-width" />
|
||||
<xsl:if test="$value">
|
||||
<xsl:attribute name="width">
|
||||
<!-- using the absolute width, problems with the relative in browser (in OOo style:rel-column-width) -->
|
||||
<xsl:call-template name="convert2px">
|
||||
<xsl:with-param name="value" select="$globalData/all-doc-styles/style[@style:name = current()/@table:style-name]/*/@style:column-width" />
|
||||
</xsl:call-template>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:element>
|
||||
<!-- *** the column-style ***
|
||||
<xsl:attribute name="width">
|
||||
<xsl:variable name="currentColumnStyleName" select="$allTableColumns/table:table-column[position() = $columnPosition]/@table:style-name" />
|
||||
<xsl:value-of select="$globalData/all-doc-styles/style[@style:name = $currentColumnStyleName]/*/@style:column-width" />
|
||||
</xsl:attribute>-->
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:element>
|
||||
<xsl:element name="colgroup">
|
||||
<xsl:for-each select="$allTableColumns/table:table-column">
|
||||
<xsl:if test="not(@table:visibility = 'collapse' or @table:visibility = 'filter')">
|
||||
<xsl:element name="col">
|
||||
<xsl:variable name="value" select="$globalData/all-doc-styles/style[@style:name = current()/@table:style-name]/*/@style:column-width" />
|
||||
<xsl:if test="$value">
|
||||
<xsl:attribute name="width">
|
||||
<!-- using the absolute width, problems with the relative in browser (in OOo style:rel-column-width) -->
|
||||
<xsl:call-template name="convert2px">
|
||||
<xsl:with-param name="value" select="$globalData/all-doc-styles/style[@style:name = current()/@table:style-name]/*/@style:column-width" />
|
||||
</xsl:call-template>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:element>
|
||||
<!-- *** the column-style ***
|
||||
<xsl:attribute name="width">
|
||||
<xsl:variable name="currentColumnStyleName" select="$allTableColumns/table:table-column[position() = $columnPosition]/@table:style-name" />
|
||||
<xsl:value-of select="$globalData/all-doc-styles/style[@style:name = $currentColumnStyleName]/*/@style:column-width" />
|
||||
</xsl:attribute>-->
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:element>
|
||||
|
||||
<xsl:call-template name="create-table-rows">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
<xsl:call-template name="create-table-rows">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows" />
|
||||
<xsl:with-param name="allTableColumns" select="$allTableColumns" />
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<!-- Creating the content of a table content using CSS styles -->
|
||||
<xsl:template name="create-table-cell-content">
|
||||
<xsl:param name="tableDataType" />
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
<xsl:param name="columnPosition" />
|
||||
<xsl:param name="currentTableColumn" />
|
||||
<!-- Creating the content of a table content using CSS styles -->
|
||||
<xsl:template name="create-table-cell-content">
|
||||
<xsl:param name="tableDataType" />
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="allTableColumns" />
|
||||
<xsl:param name="columnPosition" />
|
||||
<xsl:param name="currentTableColumn" />
|
||||
|
||||
<xsl:element name="{$tableDataType}">
|
||||
<xsl:element name="{$tableDataType}">
|
||||
|
||||
<!-- if parser reads DTD the default is set to '1' -->
|
||||
<xsl:if test="@table:number-columns-spanned and @table:number-columns-spanned > 1">
|
||||
<xsl:attribute name="colspan">
|
||||
<xsl:value-of select="@table:number-columns-spanned" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<!-- if parser reads DTD the default is set to '1' -->
|
||||
<xsl:if test="@table:number-rows-spanned and @table:number-rows-spanned > 1">
|
||||
<xsl:attribute name="rowspan">
|
||||
<xsl:value-of select="@table:number-rows-spanned" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<!-- if parser reads DTD the default is set to '1' -->
|
||||
<xsl:if test="@table:number-columns-spanned and @table:number-columns-spanned > 1">
|
||||
<xsl:attribute name="colspan">
|
||||
<xsl:value-of select="@table:number-columns-spanned" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<!-- if parser reads DTD the default is set to '1' -->
|
||||
<xsl:if test="@table:number-rows-spanned and @table:number-rows-spanned > 1">
|
||||
<xsl:attribute name="rowspan">
|
||||
<xsl:value-of select="@table:number-rows-spanned" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
|
||||
<!-- *** the cell-style *** -->
|
||||
<!-- The cell style has no conclusion with the column style, so we switch the order/priorities due to browser issues
|
||||
<!-- *** the cell-style *** -->
|
||||
<!-- The cell style has no conclusion with the column style, so we switch the order/priorities due to browser issues
|
||||
|
||||
The cell-style depends on two attributes:
|
||||
The cell-style depends on two attributes:
|
||||
|
||||
1) table:style-name - the style properties of cell. When they exist, a default alignement (cp. below) will be added for the
|
||||
case of no alignment in the style exist.
|
||||
1) table:style-name - the style properties of cell. When they exist, a default alignment (cp. below) will be added for the
|
||||
case of no alignment in the style exist.
|
||||
|
||||
2) office:value-type - the value type of the table-cell giving the default alignments.
|
||||
By default a string value is left aligned, all other are aligned:right.
|
||||
-->
|
||||
<xsl:choose>
|
||||
<xsl:when test="@table:style-name">
|
||||
<xsl:call-template name="set-styles">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="styleName" select="@table:style-name" />
|
||||
<xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- Cells without a style use the 'table:default-cell-style-name'
|
||||
when there is no default cell style specified for the current column. -->
|
||||
<xsl:variable name="defaultCellStyleName" select="$currentTableColumn/@table:default-cell-style-name" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="$defaultCellStyleName">
|
||||
<xsl:call-template name="set-styles">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="styleName" select="$defaultCellStyleName" />
|
||||
<xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- No cell style exists, nor a default table cell style for the column -->
|
||||
<xsl:attribute name="style">
|
||||
<!-- sets cell alignment dependent of cell value type -->
|
||||
<xsl:call-template name="set-cell-alignment" />
|
||||
</xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
2) office:value-type - the value type of the table-cell giving the default alignments.
|
||||
By default a string value is left aligned, all other are aligned:right.
|
||||
-->
|
||||
<xsl:choose>
|
||||
<xsl:when test="@table:style-name">
|
||||
<xsl:call-template name="set-styles">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="styleName" select="@table:style-name" />
|
||||
<xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- Cells without a style use the 'table:default-cell-style-name'
|
||||
when there is no default cell style specified for the current column. -->
|
||||
<xsl:variable name="defaultCellStyleName" select="$currentTableColumn/@table:default-cell-style-name" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="$defaultCellStyleName">
|
||||
<xsl:call-template name="set-styles">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
<xsl:with-param name="styleName" select="$defaultCellStyleName" />
|
||||
<xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- No cell style exists, nor a default table cell style for the column -->
|
||||
<xsl:attribute name="style">
|
||||
<!-- sets cell alignment dependent of cell value type -->
|
||||
<xsl:call-template name="set-cell-alignment" />
|
||||
</xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:if test="$debugEnabled">
|
||||
<xsl:message>A table cell '<xsl:value-of select="$tableDataType" />' element has been added!</xsl:message>
|
||||
</xsl:if>
|
||||
<xsl:if test="$debugEnabled">
|
||||
<xsl:message>A table cell '<xsl:value-of select="$tableDataType" />' element has been added!</xsl:message>
|
||||
</xsl:if>
|
||||
|
||||
<!-- empty cell tags produce problems with width CSS style on itself other table cells as well
|
||||
therefore an non breakable space ( / ) have been inserted.-->
|
||||
<xsl:choose>
|
||||
<xsl:when test="node()">
|
||||
<xsl:call-template name="apply-styles-and-content">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="apply-styles-and-content">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!-- empty cell tags produce problems with width CSS style on itself other table cells as well
|
||||
therefore a non breakable space ( / ) have been inserted.-->
|
||||
<xsl:choose>
|
||||
<xsl:when test="node()">
|
||||
<xsl:call-template name="apply-styles-and-content">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="apply-styles-and-content">
|
||||
<xsl:with-param name="globalData" select="$globalData" />
|
||||
</xsl:call-template>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Sets the cell alignment by the 'office:value-type' of the 'table:table-cell'.
|
||||
Strings have a left alignment, other values right -->
|
||||
<xsl:template name="set-cell-alignment">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@office:value-type and not(@office:value-type = 'string')">text-align:right; </xsl:when>
|
||||
<xsl:otherwise>text-align:left;</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<!-- Sets the cell alignment by the 'office:value-type' of the 'table:table-cell'.
|
||||
Strings have a left alignment, other values right -->
|
||||
<xsl:template name="set-cell-alignment">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@office:value-type and not(@office:value-type = 'string')">text-align:right; </xsl:when>
|
||||
<xsl:otherwise>text-align:left;</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<!-- Sets styles of a cell -->
|
||||
<xsl:template name="set-styles">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="styleName" />
|
||||
<xsl:param name="currentTableColumn" />
|
||||
<!-- Sets styles of a cell -->
|
||||
<xsl:template name="set-styles">
|
||||
<xsl:param name="globalData" />
|
||||
<xsl:param name="styleName" />
|
||||
<xsl:param name="currentTableColumn" />
|
||||
|
||||
<xsl:attribute name="style">
|
||||
<!-- sets cell alignment dependent of cell value type -->
|
||||
<xsl:call-template name="set-cell-alignment" />
|
||||
<xsl:attribute name="style">
|
||||
<!-- sets cell alignment dependent of cell value type -->
|
||||
<xsl:call-template name="set-cell-alignment" />
|
||||
|
||||
<!-- set column style (disjunct of cell style) -->
|
||||
<xsl:value-of select="$globalData/all-styles/style[@style:name = $currentTableColumn/@table:style-name]/final-properties" />
|
||||
<!-- set column style (disjunct of cell style) -->
|
||||
<xsl:value-of select="$globalData/all-styles/style[@style:name = $currentTableColumn/@table:style-name]/final-properties" />
|
||||
|
||||
</xsl:attribute>
|
||||
</xsl:attribute>
|
||||
|
||||
<!-- cell style header -->
|
||||
<xsl:attribute name="class">
|
||||
<xsl:value-of select="translate($styleName, '.,;: %()[]/\+', '_____________')"/>
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
<!-- cell style header -->
|
||||
<xsl:attribute name="class">
|
||||
<xsl:value-of select="translate($styleName, '.,;: %()[]/\+', '_____________')"/>
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user