集成OpenOffice替换为LibreOffice

This commit is contained in:
陈精华
2021-06-23 10:26:22 +08:00
parent 8a1eebb9b0
commit 79341b2c8e
14724 changed files with 2184695 additions and 551131 deletions

View File

@@ -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: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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" 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="w wx aml o dt v" xmlns:fla="urn:experimental:fla">
<xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0"/>
<xsl:include href="../../common/measure_conversion.xsl"/>
@@ -64,7 +59,7 @@
</xsl:template>
<xsl:template match="w:wordDocument">
<office:document office:mimetype="application/vnd.oasis.opendocument.text" office:version="1.0">
<fla:fla.activate/>
<fla:fla.activate/>
<xsl:apply-templates select="o:DocumentProperties"/>
<xsl:apply-templates select="w:docOleData" mode="init"/>
<xsl:apply-templates select="w:docPr"/>
@@ -213,9 +208,9 @@
<xsl:apply-templates select="w:pPr/w:rPr"/>
<xsl:apply-templates select="w:rPr"/>
-->
<xsl:for-each select="w:rPr">
<xsl:call-template name="text-properties"/>
</xsl:for-each>
<xsl:for-each select="w:rPr">
<xsl:call-template name="text-properties"/>
</xsl:for-each>
</xsl:element>
</xsl:when>
<xsl:otherwise>
@@ -233,12 +228,12 @@
<xsl:template match="w:body">
<xsl:element name="office:body">
<xsl:element name="office:text">
<!-- to add the sequece variable declaration at the begining of the office:body G.Y.-->
<!-- to add the sequence variable declaration at the beginning of the office:body G.Y.-->
<text:sequence-decls>
<xsl:call-template name="default_seqence_declaration"/>
<xsl:call-template name="default_sequence_declaration"/>
<xsl:apply-templates select="/w:wordDocument/w:body//w:instrText[substring(normalize-space(text()),1,3) = 'SEQ' ] | /w:wordDocument/w:body//w:fldSimple[substring(normalize-space(@w:instr),1,3) = 'SEQ' ] " mode="sequence_declare"/>
</text:sequence-decls>
<!-- add the user field variables declare for Docpropety fields importing G.Y.-->
<!-- add the user field variables declare for Docproperty fields importing G.Y.-->
<text:user-field-decls>
<xsl:call-template name="user_fields_declare_docproperty"/>
</text:user-field-decls>
@@ -258,87 +253,4 @@
<style:graphic-properties text:anchor-type="paragraph" svg:x="0in" svg:y="0in" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content"/>
</style:style>
</xsl:template>
<xsl:template name="ConvertMeasure">
<xsl:param name="TargetMeasure" select="'cm'"/>
<xsl:param name="TargetTruncate" select=" 'all' "/>
<xsl:param name="value"/>
<!-- When TargetTruncate ='all' it returns the number whichsoever the return value is negative or positive
When TargetTruncate ='nonNegative' it only returns nonNegative number, all negative number to be returned as 0
When TargetTruncate ='positive" it only returns positive number, all nonPositive number to be returned as 1 -->
<xsl:variable name="return_value">
<xsl:choose>
<!-- remove the measure mark, if the value is null, the result should be 0. Must be the first case -->
<xsl:when test="string-length(translate($value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ','')) = 0">0</xsl:when>
<xsl:when test="string-length(translate($value,'-.0123456789 ','')) = 0">
<xsl:value-of select="$value"/>
</xsl:when>
<xsl:when test="$TargetMeasure = 'cm'">
<xsl:call-template name="convert2cm">
<xsl:with-param name="value" select="$value"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$TargetMeasure = 'pt'">
<xsl:call-template name="convert2pt">
<xsl:with-param name="value" select="$value"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$TargetMeasure = 'twip'">
<xsl:call-template name="convert2twip">
<xsl:with-param name="value" select="$value"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$TargetMeasure = 'in'">
<xsl:call-template name="convert2in">
<xsl:with-param name="value" select="$value"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$TargetTruncate = 'all' ">
<xsl:choose>
<xsl:when test="number($TargetMeasure) = 'NaN' ">
<xsl:value-of select=" '0' "/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$return_value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$TargetTruncate = 'nonNegative' ">
<xsl:choose>
<xsl:when test="number($TargetMeasure) = 'NaN' ">
<xsl:value-of select=" '0' "/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test=" $return_value &lt; 0 ">
<xsl:value-of select=" '0' "/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$return_value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$TargetTruncate = 'positive' ">
<xsl:choose>
<xsl:when test="number($TargetMeasure) = 'NaN' ">
<xsl:value-of select=" '1' "/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test=" $return_value &lt;= 0 ">
<xsl:value-of select=" '1' "/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$return_value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@@ -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: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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" 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="w wx aml o dt fo v">
<xsl:template name="ms_word_draw_map2ooo_custom_draw">
<xsl:param name="ms_word_draw_type"/>

View File

@@ -1,33 +1,25 @@
<?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.
*
***********************************************************-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" 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" xmlns:xalan="http://xml.apache.org/xalan" xmlns:oleextracter="MyOleExtracter" xmlns:ole="java:com.sun.star.comp.xsltfilter.XSLTFilterOLEExtracter" xmlns:java="http://saxon.sf.net/java-type" exclude-result-prefixes="w wx aml o dt v xalan ole oleextracter java" extension-element-prefixes="oleextracter">
<!--
* 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: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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" 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" xmlns:ole="http://libreoffice.org/2011/xslt/ole" exclude-result-prefixes="w wx aml o dt v">
<xsl:include href="wordml2ooo_custom_draw.xsl"/>
<xsl:include href="wordml2ooo_path.xsl"/>
<xsl:param name="oleExtractor" as="java:com.sun.star.comp.xsltfilter.XSLTFilterOLEExtracter" select="ole:new()"/>
<xsl:param name="XMultiServiceFactory" as="java:com.sun.star.lang.XMultiServiceFactory" select="ole:init($oleExtractor, 'uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager')"/>
<xsl:key name="imagedata" match="w:binData" use="@w:name"/>
<xsl:key name="shapetype" match="v:shapetype" use="concat('#', @id)"/>
<xsl:template match="v:fill" mode="get-xsl-number">
@@ -213,11 +205,11 @@
<xsl:with-param name="namenumber" select="concat('markerend',$stroke-num)"/>
</xsl:call-template>
</xsl:if>
<!--<v:stroke dashstyle="1 1" startarrow="diamond" startarrowwidth="wide" startarrowlength="long" endarrow="block"
<!--<v:stroke dashstyle="1 1" startarrow="diamond" startarrowwidth="wide" startarrowlength="long" endarrow="block"
endarrowwidth="wide" endarrowlength="long" endcap="round"/>
<draw:stroke-dash draw:name="2 2dots 1 dash" draw:style="rect" draw:dots1="2" draw:dots2="1" draw:dots2-length="0.0795in"
<draw:stroke-dash draw:name="2 2dots 1 dash" draw:style="rect" draw:dots1="2" draw:dots2="1" draw:dots2-length="0.0795in"
draw:distance="0.102in"/>
Hehe,It need to be revised-->
Hehe, it needs to be revised-->
</xsl:if>
</xsl:if>
</xsl:template>
@@ -356,13 +348,13 @@
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="lastest-substr-after">
<xsl:template name="latest-substr-after">
<xsl:param name="str"/>
<xsl:param name="substr"/>
<xsl:choose>
<xsl:when test="contains($str,$substr) and string-length(substring-before($str,$substr)) = 0">
<xsl:variable name="restr" select="substring-after($str,$substr)"/>
<xsl:call-template name="lastest-substr-after">
<xsl:call-template name="latest-substr-after">
<xsl:with-param name="str" select="$restr"/>
<xsl:with-param name="substr" select="$substr"/>
</xsl:call-template>
@@ -463,7 +455,7 @@
</xsl:call-template>
</xsl:variable>
<xsl:variable name="dot2substr">
<xsl:call-template name="lastest-substr-after">
<xsl:call-template name="latest-substr-after">
<xsl:with-param name="str" select="$dstyle"/>
<xsl:with-param name="substr" select="$modesubstr1"/>
</xsl:call-template>
@@ -577,7 +569,6 @@
</xsl:when>
</xsl:choose>
<xsl:if test="parent::w:pict/o:OLEObject">
<xsl:variable name="style" select="concat(@style, ';')"/>
<xsl:variable name="width" select="substring-before( substring-after($style,'width:') ,';')"/>
<xsl:variable name="height" select="substring-before(substring-after($style,'height:'),';')"/>
<xsl:attribute name="draw:visible-area-left">0cm</xsl:attribute>
@@ -593,9 +584,9 @@
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="draw:ole-draw-aspect">
<!-- DVASPECT_CONTENT = 1,
DVASPECT_THUMBNAIL = 2,
DVASPECT_ICON = 4,
<!-- DVASPECT_CONTENT = 1,
DVASPECT_THUMBNAIL = 2,
DVASPECT_ICON = 4,
DVASPECT_DOCPRINT = 8 -->
<xsl:variable name="ms-aspect" select="parent::w:pict/o:OLEObject/@DrawAspect"/>
<xsl:choose>
@@ -1503,7 +1494,7 @@
</xsl:attribute>
</xsl:if>
<xsl:variable name="typeid_adj">
<!--for fix the bug of version 1.63: the following discription: adj="-11796480,,5400" in OOo should be: modifier =" -11796480 0 5400"-->
<!--for fix the bug of version 1.63: the following description: adj="-11796480,,5400" in OOo should be: modifier =" -11796480 0 5400"-->
<xsl:variable name="tmp_adj">
<xsl:value-of select="key('shapetype',@type)/@adj"/>
</xsl:variable>
@@ -1522,21 +1513,21 @@
</xsl:if>
</xsl:variable>
<!--the following choose statement code will process the revised modifier
It happens that if a drawing elements has more than 2 modifier, the modifier (or say adj
It happens that if a drawing elements has more than 2 modifier, the modifier (or say adj
in wordml) can be adjusted and only the modified adj is recorded.
what makes it more compicated is that adj support both comma and blanks.
what makes it more complicated is that adj support both comma and blanks.
so you have to use kickblanks template to kick the blanks and change it to comma version.
<key('shapetype',@type)/v:textpath[1]-->
<xsl:choose>
<xsl:when test="string-length($typeid_adj) = 0">
<xsl:if test="contains(@adj,',')">
<!--Please Note that the modifier can be more than 2 , so use a translate can be more efficient.
-####Note that comma cann't be recognized by OOo's modifiers
-####Note that comma can't be recognized by OOo's modifiers
<xsl:variable name="adjust-x" select="substring-before(@adj,',')"/>
<xsl:variable name="adjust-y" select="substring-after(@adj,',')"/>
<xsl:variable name="adjuststr">
<xsl:if test="$adjust-x and $adjust-y">
-####Note that comma cann't be recognized by OOo's modifiers->
-####Note that comma can't be recognized by OOo's modifiers->
<xsl:value-of select="concat( $adjust-x , ' ' ,$adjust-y )"/>
</xsl:if>
</xsl:variable>-->
@@ -1545,14 +1536,14 @@
</xsl:attribute>
</xsl:if>
<xsl:if test="@adj and not(contains(@adj,','))">
<!--####Note that comma cann't be recognized by OOo's modifiers.-->
<!--####Note that comma can't be recognized by OOo's modifiers.-->
<xsl:attribute name="draw:modifiers">
<xsl:value-of select="@adj"/>
</xsl:attribute>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<!--Means that you have to care about 2 adj parameters which is defferent-->
<!--Means that you have to care about 2 adj parameters which is different-->
<xsl:variable name="mark_used_by_typeid">
<xsl:if test="contains($typeid_adj, ',' )">
<xsl:value-of select="',' "/>
@@ -1638,43 +1629,16 @@
</xsl:element>
</xsl:template>
<xsl:template match="w:docOleData" mode="init">
<xsl:choose>
<xsl:when test="element-available('oleextracter:init')">
<oleextracter:init UNOURL="uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="ole:init($oleExtractor, 'uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="w:binData[@w:name='oledata.mso']" mode="oledata.mso"/>
</xsl:template>
<xsl:template match="w:docOleData" mode="exit">
<oleextracter:exit/>
</xsl:template>
<xsl:template match="w:binData" mode="oledata.mso">
<!-- <xsl:choose>
<xsl:when test="element-available('oleextracter:getByName')">
<xsl:variable name="tmp" select="oleextracter:insertByName('oledata.mso', translate(text(),'&#10;&#13;&#32;','' ) )"/>
</xsl:when>
<xsl:otherwise>-->
<xsl:variable name="tmp" select="ole:insertByName($oleExtractor,'oledata.mso', translate(text(),'&#10;&#13;&#32;','' ) )"/>
<!-- </xsl:otherwise>
</xsl:choose> -->
<xsl:variable name="tmp" select="ole:insertByName('oledata.mso', translate(text(),'&#10;&#13;&#32;','' ) )"/>
</xsl:template>
<xsl:template match="o:OLEObject " mode="output">
<!-- depends on i43230,we can uncomment this code or find another way after i43230 got fixed -->
<draw:object-ole>
<xsl:element name="office:binary-data">
<!--
<xsl:choose>
<xsl:when test="element-available('oleextracter:getByName')">
<xsl:value-of select="translate(oleextracter:getByName(@ObjectID),'&#13;','')"/>
</xsl:when>
<xsl:otherwise> -->
<xsl:value-of select="translate(ole:getByName($oleExtractor,@ObjectID),'&#13;','')"/>
<!--
</xsl:otherwise>
</xsl:choose> -->
<xsl:value-of select="translate(ole:getByName(@ObjectID),'&#13;','')"/>
</xsl:element>
</draw:object-ole>
</xsl:template>
@@ -1720,7 +1684,7 @@
<xsl:number from="/w:wordDocument/w:body" level="any" count="v:textpath" format="1"/>
</xsl:variable>
<xsl:variable name="font-family">
<!-- we need remove the addtional &quot; from font-family -->
<!-- we need remove the additional &quot; from font-family -->
<xsl:value-of select="translate(substring-before(substring-after(@style,'font-family:'),';'), '&quot;' ,'')"/>
</xsl:variable>
<xsl:variable name="font-size">
@@ -1774,30 +1738,30 @@
</xsl:template>
<xsl:template match="v:shapetype" mode="output">
<xsl:param name="instance" select="''"/>
<!--#Dummy after version 1.63 The following test is for the adj attribute of the file. It is Dummy now.
<xsl:if test="not($instance/@adj)">
<xsl:if test="contains(@adj,',')">-->
<!--#Dummy after version 1.63 The following test is for the adj attribute of the file. It is Dummy now.
<xsl:if test="not($instance/@adj)">
<xsl:if test="contains(@adj,',')">-->
<!--Please Note that the modifier can be more than 2 , so use a translate can be more efficient.
-####Note that comma cann't be recognized by OOo's modifiers
-####Note that comma can't be recognized by OOo's modifiers
<xsl:variable name="adjust-x" select="substring-before(@adj,',')"/>
<xsl:variable name="adjust-y" select="substring-after(@adj,',')"/>
<xsl:variable name="adjuststr">
<xsl:if test="$adjust-x and $adjust-y">
< -####Note that comma cann't be recognized by OOo's modifiers.->
< -####Note that comma can't be recognized by OOo's modifiers.->
<xsl:value-of select="concat( $adjust-x , ' ' ,$adjust-y )"/>
</xsl:if>
</xsl:variable>-->
<!--Dummy after version 1.63 <xsl:attribute name="draw:modifiers">
<xsl:value-of select="translate(@adj, ',' , ' ' )"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@adj and not(contains(@adj,','))">-->
<!--####Note that comma cann't be recognized by OOo's modifiers.-->
<!--Dummy after version 1.63 <xsl:attribute name="draw:modifiers">
<xsl:value-of select="@adj"/>
</xsl:attribute>
</xsl:if>
</xsl:if>-->
<!--Dummy after version 1.63 <xsl:attribute name="draw:modifiers">
<xsl:value-of select="translate(@adj, ',' , ' ' )"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@adj and not(contains(@adj,','))">-->
<!--####Note that comma can't be recognized by OOo's modifiers.-->
<!--Dummy after version 1.63 <xsl:attribute name="draw:modifiers">
<xsl:value-of select="@adj"/>
</xsl:attribute>
</xsl:if>
</xsl:if>-->
<xsl:variable name="viewbox">
<xsl:value-of select="'0 0'"/>
<xsl:value-of select="' '"/>
@@ -1900,19 +1864,19 @@
</xsl:when>
<!-- -->
<!--><xsl:when test="$command = 'atan2' ">
<xsl:variable name="value1" select="substring-before($tmp,' ')"/>
<xsl:variable name="value2" select="substring-after($tmp,' ')"/>
<xsl:value-of select="concat( 'atan' , '( ' , $value2, '/' , $value1 , ')' )"/>
</xsl:when><- -->
<!-- ellipse and sumangle are always used by arc commans like this
eqn="ellipse @24 @4 height" ; and eqn="sumangle @2 360 0"
mod is always used too.-->
<xsl:variable name="value1" select="substring-before($tmp,' ')"/>
<xsl:variable name="value2" select="substring-after($tmp,' ')"/>
<xsl:value-of select="concat( 'atan' , '( ' , $value2, '/' , $value1 , ')' )"/>
</xsl:when><- -->
<!-- ellipse and sumangle are always used by arc command like this
eqn="ellipse @24 @4 height" ; and eqn="sumangle @2 360 0"
mod is always used too.-->
<!--mod =sqrt( v*v + P1×P1 + P2×P2). ( 3 parameters )-->
<xsl:when test="$command='mod' ">
<xsl:variable name="value1" select="substring-before($tmp,' ')"/>
<xsl:variable name="value2" select="substring-before(substring-after($tmp,' '), ' ')"/>
<xsl:variable name="value3" select="substring-after(substring-after($tmp,' '), ' ')"/>
<xsl:value-of select="concat( 'sqrt( ' , $value3, ' * ',$value3, ' + ' ,$value2, ' * ' ,$value2, ' + ' ,$value1, ' * ', $value1, ' )' )"/>
<xsl:value-of select="concat( 'sqrt( ' , $value3, ' * ',$value3, ' + ' ,$value2, ' * ' ,$value2, ' + ' ,$value1, ' * ', $value1, ' )' )"/>
</xsl:when>
<!--ellipse= P2* sqrt(1 - v*v /P1*P1) ( 3 parameters )-->
<xsl:when test="$command='ellipse' ">
@@ -1923,11 +1887,11 @@
</xsl:when>
<!--sumangle =v + P1×2^16 - P2×2^16. ( 3 parameters )-->
<!--<xsl:when test="$command='sumangle' ">
<xsl:variable name="value1" select="substring-before($tmp,' ')"/>
<xsl:variable name="value2" select="substring-before(substring-after($tmp,' '), ' ')"/>
<xsl:variable name="value3" select="substring-after(substring-after($tmp,' '), ' ')"/>
<xsl:value-of select="concat( $value1 , '+' , $value2 , ' * ' , '65535',' + ', $value2,' - ' ,$value3 , ' * ', '65535', ' - ', $value3)"/>
</xsl:when>-->
<xsl:variable name="value1" select="substring-before($tmp,' ')"/>
<xsl:variable name="value2" select="substring-before(substring-after($tmp,' '), ' ')"/>
<xsl:variable name="value3" select="substring-after(substring-after($tmp,' '), ' ')"/>
<xsl:value-of select="concat( $value1 , '+' , $value2 , ' * ' , '65535',' + ', $value2,' - ' ,$value3 , ' * ', '65535', ' - ', $value3)"/>
</xsl:when>-->
<!--sumangle =v + P1×2^16 - P2×2^16. ( 3 parameters )-->
<xsl:when test="$command='sumangle' ">
<xsl:variable name="value1" select="substring-before($tmp,' ')"/>
@@ -1936,7 +1900,7 @@
<xsl:value-of select="concat( $value1 , '+' , $value2 , '*pi/180',' - ' ,$value3 , '*pi/180' )"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>Find a unsupported formule:<xsl:value-of select="$v-formula"/>
<xsl:message>Find an unsupported formula:<xsl:value-of select="$v-formula"/>
</xsl:message>
<!--<xsl:value-of select="'0'"/><-for release use-->
<xsl:value-of select="concat('not found this:', $v-formula)"/>
@@ -2013,7 +1977,7 @@
</xsl:if>
</xsl:element>
</xsl:template>
<!--this template map word's points to svg:viewbox's point they are quite differect because word's use pt but svg's use 0.001cm as a unit-->
<!--this template map word's points to svg:viewbox's point they are quite different because word's use pt but svg's use 0.001cm as a unit-->
<xsl:template name="wordpoints2oopoints">
<xsl:param name="input_points"/>
<xsl:param name="input_x"/>
@@ -2203,7 +2167,4 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xalan:component prefix="oleextracter" elements="init exit" functions="getByName insertByName">
<xalan:script lang="javaclass" src="xalan://com.sun.star.comp.xsltfilter.XSLTFilterOLEExtracter"/>
</xalan:component>
</xsl:stylesheet>

View File

@@ -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: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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" 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="w wx aml o dt fo v">
<!--Generally, The MS fields can be represented in two forms, simple field w:fldsimple or complicated field
w:fldChar, so when importing we have to take care of two possible forms of the same type field -->
@@ -230,107 +225,107 @@
<xsl:choose>
<xsl:when test="contains($instr_command, 'Author' ) ">
<text:user-field-get text:name="Author">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Bytes' ) ">
<text:user-field-get text:name="Bytes">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'CharactersWithSpaces' ) ">
<text:user-field-get text:name="CharactersWithSpaces">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Category' ) ">
<text:user-field-get text:name="Category">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Characters' ) ">
<text:user-field-get text:name="Characters">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Comments' ) ">
<text:user-field-get text:name="Comments">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Company' ) ">
<text:user-field-get text:name="Company">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'CreateTime' ) ">
<text:user-field-get text:name="CreateTime">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'HyperlinkBase' ) ">
<text:user-field-get text:name="HyperlinkBase">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Keywords' ) ">
<text:user-field-get text:name="Keywords">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'LastPrinted' ) ">
<text:user-field-get text:name="LastPrinted">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'LastSavedBy' ) ">
<text:user-field-get text:name="LastSavedBy">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'LastSavedTime' ) ">
<text:user-field-get text:name="LastSavedTime">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Lines' ) ">
<text:user-field-get text:name="Lines">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Manager' ) ">
<text:user-field-get text:name="Manager">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'NameofApplication' ) ">
<text:user-field-get text:name="NameofApplication">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'ODMADocId' ) ">
<text:user-field-get text:name="ODMADocId">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Pages' ) ">
<text:user-field-get text:name="Pages">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Paragraphs' ) ">
<text:user-field-get text:name="Paragraphs">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'RevisionNumber' ) ">
<text:user-field-get text:name="RevisionNumber">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Security' ) ">
<text:user-field-get text:name="Security">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Subject' ) ">
<text:user-field-get text:name="Subject">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Template' ) ">
<text:user-field-get text:name="Template">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Title' ) ">
<text:user-field-get text:name="Title">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'TotalEditingTime' ) ">
<text:user-field-get text:name="TotalEditingTime">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Words' ) ">
<text:user-field-get text:name="Words">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
</xsl:choose>
</xsl:when>
@@ -536,107 +531,107 @@
<xsl:choose>
<xsl:when test="contains($instr_command, 'Author' ) ">
<text:user-field-get text:name="Author">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Bytes' ) ">
<text:user-field-get text:name="Bytes">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Category' ) ">
<text:user-field-get text:name="Category">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'CharactersWithSpaces' ) ">
<text:user-field-get text:name="CharactersWithSpaces">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Characters' ) ">
<text:user-field-get text:name="Characters">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Comments' ) ">
<text:user-field-get text:name="Comments">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Company' ) ">
<text:user-field-get text:name="Company">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'CreateTime' ) ">
<text:user-field-get text:name="CreateTime">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'HyperlinkBase' ) ">
<text:user-field-get text:name="HyperlinkBase">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Keywords' ) ">
<text:user-field-get text:name="Keywords">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'LastPrinted' ) ">
<text:user-field-get text:name="LastPrinted">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'LastSavedBy' ) ">
<text:user-field-get text:name="LastSavedBy">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'LastSavedTime' ) ">
<text:user-field-get text:name="LastSavedTime">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Lines' ) ">
<text:user-field-get text:name="Lines">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Manager' ) ">
<text:user-field-get text:name="Manager">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'NameofApplication' ) ">
<text:user-field-get text:name="NameofApplication">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'ODMADocId' ) ">
<text:user-field-get text:name="ODMADocId">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Pages' ) ">
<text:user-field-get text:name="Pages">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Paragraphs' ) ">
<text:user-field-get text:name="Paragraphs">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'RevisionNumber' ) ">
<text:user-field-get text:name="RevisionNumber">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Security' ) ">
<text:user-field-get text:name="Security">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Subject' ) ">
<text:user-field-get text:name="Subject">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Template' ) ">
<text:user-field-get text:name="Template">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Title' ) ">
<text:user-field-get text:name="Title">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'TotalEditingTime' ) ">
<text:user-field-get text:name="TotalEditingTime">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
<xsl:when test="contains($instr_command, 'Words' ) ">
<text:user-field-get text:name="Words">
</text:user-field-get>
</text:user-field-get>
</xsl:when>
</xsl:choose>
</xsl:when>
@@ -674,17 +669,17 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="default_seqence_declaration">
<xsl:template name="default_sequence_declaration">
<text:sequence-decl text:display-outline-level="0" text:name="Illustration">
</text:sequence-decl>
</text:sequence-decl>
<text:sequence-decl text:display-outline-level="0" text:name="Table">
</text:sequence-decl>
</text:sequence-decl>
<text:sequence-decl text:display-outline-level="0" text:name="Text">
</text:sequence-decl>
</text:sequence-decl>
<text:sequence-decl text:display-outline-level="0" text:name="Drawing">
</text:sequence-decl>
</text:sequence-decl>
<text:sequence-decl text:display-outline-level="0" text:name="AutoNr">
</text:sequence-decl>
</text:sequence-decl>
</xsl:template>
<xsl:template match="w:instrText | w:fldSimple" mode="sequence_declare">
<text:sequence-decl text:display-outline-level="0">
@@ -1233,7 +1228,7 @@
<xsl:attribute name="office:string-value"><xsl:value-of select="$field_content"/></xsl:attribute>
</text:user-field-decl>
</xsl:template>
<!-- =========this following template to convert the ms number format to OOo wirter format === -->
<!-- =========this following template to convert the ms number format to OOo writer format === -->
<xsl:template name="get_field_num_format">
<xsl:param name="input_MS_num_format"/>
<xsl:choose>
@@ -1276,7 +1271,7 @@
<xsl:text>, , , ...</xsl:text>
</xsl:when>
<xsl:when test="contains($input_MS_num_format, 'CHINESENUM2' )">
<xsl:text>, , , ...</xsl:text>
<xsl:text>, , , ...</xsl:text>
</xsl:when>
<xsl:when test="contains($input_MS_num_format, 'DBNUM3' ) ">
<xsl:text>, , , ...</xsl:text>
@@ -1299,7 +1294,10 @@
<xsl:when test="contains($input_MS_num_format, 'ALPHABETIC' ) ">
<xsl:text>A</xsl:text>
</xsl:when>
<xsl:when test="contains($input_MS_num_format, 'hebrew2' ) ">
<xsl:when test="contains($input_MS_num_format, 'hebrew1' ) ">
<xsl:text>א, י, ק, ...</xsl:text>
</xsl:when>
<xsl:when test="contains($input_MS_num_format, 'hebrew2' ) ">
<xsl:text>א, ב, ג, ...</xsl:text>
</xsl:when>
<xsl:when test="contains($input_MS_num_format, 'ArabicAlpha' ) ">
@@ -1323,7 +1321,7 @@
</xsl:choose>
</xsl:template -->
<!-- ========= the following code is to generate the date styles for date/time fields ============ -->
<!--the default date styel content -->
<!--the default date style content -->
<xsl:template name="default_date_style_content">
<number:year number:style="long">
</number:year>
@@ -1335,17 +1333,17 @@
</number:day>
<number:text> </number:text>
<number:hours>
</number:hours>
</number:hours>
<number:text>:</number:text>
<number:minutes number:style="long">
</number:minutes>
</number:minutes>
<number:text>:</number:text>
<number:seconds number:style="long">
</number:seconds>
</number:seconds>
<number:am-pm>
</number:am-pm>
</number:am-pm>
</xsl:template>
<!--the default date styel -->
<!--the default date style -->
<xsl:template name="default_date_style">
<number:date-style style:name="NDF1">
<xsl:call-template name="default_date_style_content"/>
@@ -1512,55 +1510,55 @@
<xsl:choose>
<xsl:when test="$input_date_format_pattern = 'am/pm' ">
<number:am-pm>
</number:am-pm>
</number:am-pm>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'yyyy' ">
<number:year number:style="long">
</number:year>
</number:year>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'yy' ">
<number:year>
</number:year>
</number:year>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'MMMM' ">
<number:month number:style="long" number:textual="true">
</number:month>
</number:month>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'MMM' ">
<number:month number:textual="true">
</number:month>
</number:month>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'MM' ">
<number:month number:style="long">
</number:month>
</number:month>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'M' ">
<number:month>
</number:month>
</number:month>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'dddd' ">
<number:day-of-week number:style="long">
</number:day-of-week>
</number:day-of-week>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'ddd' ">
<number:day-of-week>
</number:day-of-week>
</number:day-of-week>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'dd' ">
<number:day number:style="long">
</number:day>
</number:day>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'd' ">
<number:day>
</number:day>
</number:day>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'mm' ">
<number:minutes number:style="long">
</number:minutes>
</number:minutes>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'm' ">
<number:minutes>
</number:minutes>
</number:minutes>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'hh' ">
<number:hours number:style="long">
@@ -1568,7 +1566,7 @@
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'h' ">
<number:hours>
</number:hours>
</number:hours>
</xsl:when>
<xsl:when test="$input_date_format_pattern = 'ss' ">
<number:seconds number:style="long">

View File

@@ -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: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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" 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="w wx aml o dt v">
<xsl:template match="w:listPr" mode="style">
<xsl:variable name="currlistid" select="w:ilfo/@w:val"/>

View File

@@ -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: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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" 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="w wx aml o dt v">
<xsl:template match="w:footnotePr" mode="config">
<text:notes-configuration text:note-class="footnote" text:citation-style-name="Footnote_20_Symbol">
@@ -391,7 +386,10 @@
<xsl:when test="$number-format = 'thai-letters' or $number-format = 'thai-numbers' or $number-format = 'thai-counting'">
<xsl:attribute name="style:num-format">ก, ข, ฃ, ...</xsl:attribute>
</xsl:when>
<xsl:when test="$number-format = 'hebrew-1' or $number-format = 'hebrew-2'">
<xsl:when test="$number-format = 'hebrew-1'">
<xsl:attribute name="style:num-format">א, י, ק, ...</xsl:attribute>
</xsl:when>
<xsl:when test="$number-format = 'hebrew-2'">
<xsl:attribute name="style:num-format">א, ב, ג, ...</xsl:attribute>
</xsl:when>
< ordinal, cardinal-text, ordinal-text, hex, chicago, bullet, ideograph-zodiac-traditional,

View File

@@ -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: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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" 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="w wx aml o dt v">
<xsl:include href="../../common/math.xsl"/>
<xsl:template name="dummy">
@@ -440,7 +435,7 @@
<xsl:with-param name="current-y" select=" $current-y"/>
</xsl:call-template>
</xsl:when>
<!--Code below is for the support of h-command like ha,hb....hi, maybe still need to revise-->
<!--Code below is for the support of h-command like ha,hb...hi, maybe still need to revise-->
<xsl:when test="$command = 'ha' ">
<xsl:variable name="new-svg-path" select="$svg-path"/>
<!--simply did nothing which might be wrong-->
@@ -585,12 +580,12 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--
<!--
**Template vmlpath2enhancedpath**
The template is resposible for converting the vml-path to enhanced-path, because the svg:path
cann't support command a now.(But heard that will be supported in OOo3.0)
And the 2nd reason of using an enhanced-path is that enhanced-path have a perfect maping to
vmlpath.(You will find out that often,we even don't need to change the parameters).
The template is responsible for converting the vml-path to enhanced-path, because the svg:path
can't support command a now.(But heard that will be supported in OOo3.0)
And the 2nd reason of using an enhanced-path is that enhanced-path have a perfect mapping to
vmlpath.(You will find out that often, we even don't need to change the parameters).
-->
<xsl:template name="vmlpath2enhancedpath">
<xsl:param name="vml-path"/>
@@ -702,7 +697,7 @@
<xsl:when test="$command = 't' ">
<!-- relative moveto -->
<xsl:variable name="new-enhanced-path" select="concat($enhanced-path ,' M ' ) "/>
<!--####maybe this is not crect because t r and v hasn't direct image in enhaced-path-->
<!--####maybe this is not created because t r and v haven't direct image in enhanced-path-->
<xsl:variable name="num-and-pos">
<xsl:call-template name="get-number-after">
<xsl:with-param name="vml-path" select="$vml-path"/>
@@ -721,7 +716,7 @@
</xsl:when>
<xsl:when test="$command = 'r' ">
<!-- relative lineto -->
<!--####maybe this is not crect because 't' 'r' and 'v' hasn't direct image in enhaced-path-->
<!--####maybe this is not created because 't' 'r' and 'v' haven't direct image in enhanced-path-->
<!-- 'l' command is not supported currently, so we use 'L' -->
<xsl:message>'l' command is not supported currently, so we use 'L'. This may case problem.</xsl:message>
<xsl:variable name="new-enhanced-path" select="concat($enhanced-path ,' L ' ) "/>
@@ -747,7 +742,7 @@
</xsl:when>
<xsl:when test="$command = 'v' ">
<!-- relative curveto -->
<!--####maybe this is not crect because 't' 'r' and 'v' hasn't direct image in enhaced-path-->
<!--####maybe this is not created because 't' 'r' and 'v' haven't direct image in enhanced-path-->
<xsl:variable name="new-enhanced-path" select="concat($enhanced-path ,' C ' ) "/>
<!--<xsl:variable name="control-and-pos">
<xsl:call-template name="get-number-after">
@@ -763,7 +758,7 @@
<xsl:with-param name="count" select="2"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="vmlpath2enhancedpath">
<xsl:call-template name="vmlpath2enhancedpath">
<xsl:with-param name="vml-path" select="$vml-path"/>
<xsl:with-param name="enhanced-path" select=" concat($new-enhanced-path , substring-before( $control-and-pos , ':') , ' ' , substring-before( $num-and-pos , ':') , ' ') "/>
<xsl:with-param name="position" select=" substring-after( $num-and-pos , ':') "/>
@@ -847,7 +842,7 @@
<xsl:with-param name="current-y" select=" $val_y "/>
</xsl:call-template>
</xsl:when>
<!--Code below is for the support of h-command like ha,hb....hi, maybe still need to revise-->
<!--Code below is for the support of h-command like ha,hb...hi, maybe still need to revise-->
<xsl:when test="$command = 'ha' ">
<xsl:variable name="new-enhanced-path" select="$enhanced-path"/>
<!--simply did nothing which might be wrong-->
@@ -981,10 +976,10 @@
</xsl:call-template>
</xsl:when>
<!--The following is 6 command which deal with arcs:
ae ->T al -> U
at -> A ar -> B
wa -> W wr ->V
These pairs of commands have shown the perfect mapping from vml-path to enhanced-path-->
ae -> T al -> U
at -> A ar -> B
wa -> W wr -> V
These pairs of commands have shown the perfect mapping from vml-path to enhanced-path-->
<xsl:when test="$command = 'ae' ">
<!-- arc on the screen with the start and end angles -->
<xsl:variable name="new-enhanced-path" select="concat($enhanced-path ,' T ' ) "/>
@@ -1005,7 +1000,7 @@
</xsl:call-template>
</xsl:when>
<xsl:when test="$command = 'al' ">
<!-- ae command plus a implicitly moveto startpoint-->
<!-- ae command plus an implicitly moveto startpoint-->
<xsl:variable name="new-enhanced-path" select="concat($enhanced-path ,' U ' ) "/>
<xsl:variable name="num-and-pos">
<xsl:call-template name="get-number-after">
@@ -1043,7 +1038,7 @@
</xsl:call-template>
</xsl:when>
<xsl:when test="$command = 'ar' ">
<!-- at command plus a implicitly moveto startpoint-->
<!-- at command plus an implicitly moveto startpoint-->
<xsl:variable name="new-enhanced-path" select="concat($enhanced-path ,' B ' ) "/>
<xsl:variable name="num-and-pos">
<xsl:call-template name="get-number-after">
@@ -1081,7 +1076,7 @@
</xsl:call-template>
</xsl:when>
<xsl:when test="$command = 'wr' ">
<!-- wa command plus a implicitly moveto startpoint-->
<!-- wa command plus an implicitly moveto startpoint-->
<xsl:variable name="new-enhanced-path" select="concat($enhanced-path ,' V ' ) "/>
<xsl:variable name="num-and-pos">
<xsl:call-template name="get-number-after">
@@ -1162,7 +1157,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="vml-path"/>
@@ -1216,7 +1211,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="vml-path"/>
@@ -1439,7 +1434,7 @@
</xsl:call-template>
</xsl:when>
<xsl:when test="string-length(translate($curr-char , '+-' ,'') ) = 0 and string-length($number) &gt; 0">
<!-- finsh it with +/- -->
<!-- finish it with +/- -->
<xsl:call-template name="format-number-pos">
<xsl:with-param name="number" select="$number"/>
<xsl:with-param name="position" select="$position"/>
@@ -1465,7 +1460,7 @@
<xsl:variable name="curr-char" select="substring($vml-path, $position , 1)"/>
<xsl:choose>
<xsl:when test="string-length(translate($curr-char , 'mlcxetrvnfsawqyb' ,'')) = 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 ">
@@ -1493,15 +1488,15 @@
</xsl:template>
<!--
**get-path- command**
This function will collect the next command from a string. If the input string should has a start of number character,
we here implictly think the command is the last-command
This function will collect the next command from a string. If the input string should has a start of number character,
we here implicitly think the command is the last-command
All of the command of vml is listed as following:
__Basic commands:__
m l c x e t r v nf ns ae al at ar wa wr qx qy qb
__Edit behavior extensions commands__
ha hb hc hd he hf hg hh hi
m l c x e t r v nf ns ae al at ar wa wr qx qy qb
__Edit behavior extensions commands__
ha hb hc hd he hf hg hh hi
So we know the longest command should be four character.The function is implemented on this basis:
So we know the longest command should be four character.The function is implemented on this basis:
-->
<xsl:template name="get-path-command">
<xsl:param name="vml-path"/>
@@ -1529,7 +1524,7 @@
<xsl:value-of select="concat( $curr-char,$second-char , ':' , $position +2)"/>
</xsl:if>
<xsl:if test="$isvalid = '0' ">
<xsl:message>ooo2wordml_path.xsl: Error command occured </xsl:message>
<xsl:message>ooo2wordml_path.xsl: Error command occurred </xsl:message>
</xsl:if>
</xsl:when>
<xsl:when test="$curr-char = 'n' ">
@@ -1546,7 +1541,7 @@
<xsl:value-of select="concat( $curr-char,$second-char , ':' , $position +2)"/>
</xsl:if>
<xsl:if test="$isvalid = '0' ">
<xsl:message>ooo2wordml_path.xsl: Error command occured </xsl:message>
<xsl:message>ooo2wordml_path.xsl: Error command occurred </xsl:message>
</xsl:if>
</xsl:when>
<xsl:when test="$curr-char = 'w' ">
@@ -1563,7 +1558,7 @@
<xsl:value-of select="concat( $curr-char,$second-char , ':' , $position +2)"/>
</xsl:if>
<xsl:if test="$isvalid = '0' ">
<xsl:message>ooo2wordml_path.xsl: Error command occured </xsl:message>
<xsl:message>ooo2wordml_path.xsl: Error command occurred </xsl:message>
</xsl:if>
</xsl:when>
<xsl:when test="$curr-char = 'q' ">
@@ -1581,7 +1576,7 @@
<xsl:value-of select="concat( $curr-char,$second-char , ':' , $position +2)"/>
</xsl:if>
<xsl:if test="$isvalid = '0' ">
<xsl:message>ooo2wordml_path.xsl: Error command occured </xsl:message>
<xsl:message>ooo2wordml_path.xsl: Error command occurred </xsl:message>
</xsl:if>
</xsl:when>
<xsl:when test="$curr-char = 'h' ">
@@ -1597,7 +1592,7 @@
<xsl:value-of select="concat( $curr-char,$second-char , ':' , $position +2)"/>
</xsl:if>
<xsl:if test="$isvalid = '0' ">
<xsl:message>ooo2wordml_path.xsl: Error command occured </xsl:message>
<xsl:message>ooo2wordml_path.xsl: Error command occurred </xsl:message>
</xsl:if>
</xsl:when>
<xsl:when test="string-length(translate($curr-char , 'mlcxetrv' ,'')) = 0 ">

View File

@@ -1,24 +1,4 @@
<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: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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" 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="w wx aml o dt v" xmlns:an="urn:flr:annotate">
<!--***********************************************************
*
* 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.
*
***********************************************************-->
<an:page-layout-properties
context-node-input="w:sectPr"
@@ -124,7 +104,7 @@
</xsl:choose>
</xsl:attribute>
<xsl:if test="not(w:cols/w:col)">
<xsl:if test="not(w:cols/w:col)">
<!-- bug in the OASIS spec resp. bug in xmloff -->
<xsl:attribute name="fo:column-gap">
<xsl:value-of select="concat(w:cols/@w:space div 567.0, 'cm')"/>
@@ -132,7 +112,7 @@
</xsl:if>
<xsl:for-each select="w:cols/w:col">
<style:column>
<style:column>
<xsl:attribute name="style:rel-width">
<xsl:value-of select="concat(@w:w, '*')"/>
</xsl:attribute>
@@ -147,12 +127,12 @@
<xsl:otherwise>0cm</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</style:column>
</style:column>
</xsl:for-each>
</style:columns>
</xsl:template>
<an:text-properties
<an:text-properties
context-node-input="w:rPr"
context-node-output="style:text-properties">
</an:text-properties >

View File

@@ -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: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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" 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="w wx aml o dt v">
<xsl:template match="w:docPr">
<office:settings>

View File

@@ -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: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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" 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="w wx aml o dt v">
<xsl:template match="w:style[@w:type='table']" mode="table">
<style:style style:family="table">
@@ -175,13 +170,13 @@
<xsl:attribute name="fo:margin-right">
<xsl:value-of select="concat($tbl_margin_right, 'in')"/>
</xsl:attribute>
<!-- If previous w:p has a page break, the table must have the page break attribute applied to it May need this for tables starting on new pages -->
<!-- <xsl:if test="parent::w:tbl/preceding-sibling::w:p[1][descendant::w:br/@w:type='page']">
<xsl:attribute name="fo:break-before">page</xsl:attribute></xsl:if> -->
<!-- If previous w:p has a page break, the table must have the page break attribute applied to it May need this for tables starting on new pages -->
<!-- <xsl:if test="parent::w:tbl/preceding-sibling::w:p[1][descendant::w:br/@w:type='page']">
<xsl:attribute name="fo:break-before">page</xsl:attribute></xsl:if> -->
<!-- initial values for tables-->
</xsl:element>
</xsl:element>
<!-- the following style is for conveting Word table text wrapping to SO Writer. Since SO Writer has no table text wrapping feature, so we use the draw:text-box as a container and put the table in draw:text-box -->
<!-- the following style is for converting Word table text wrapping to SO Writer. Since SO Writer has no table text wrapping feature, so we use the draw:text-box as a container and put the table in draw:text-box -->
<xsl:if test="w:tblpPr">
<xsl:element name="style:style">
<xsl:attribute name="style:name">TableFrame<xsl:number count="w:tblpPr" from="/w:wordDocument/w:body" level="any" format="1"/>
@@ -286,7 +281,7 @@
<xsl:value-of select="$frame_v_anchor"/>
</xsl:attribute>
<!--/xsl:if-->
<!--xsl:if test="w:tblpPr/@w:tblpXSpec" to get the horizntal alignment-->
<!--xsl:if test="w:tblpPr/@w:tblpXSpec" to get the horizontal alignment-->
<xsl:variable name="horizental_alignment">
<xsl:choose>
<xsl:when test="w:tblpPr/@w:tblpXSpec = 'left' ">
@@ -1266,11 +1261,11 @@
</xsl:template>
<xsl:template name="convert2in_special">
<!-- this template is specially to deal with w:type ='dxa' situation -->
<xsl:param name="orignal_value"/>
<xsl:param name="original_value"/>
<xsl:choose>
<xsl:when test="contains($orignal_value, 'dxa') ">
<xsl:when test="contains($original_value, 'dxa') ">
<xsl:variable name="table_measurement_new_value">
<xsl:value-of select="concat( substring-before($orignal_value,'dxa'), 'twip')"/>
<xsl:value-of select="concat( substring-before($original_value,'dxa'), 'twip')"/>
</xsl:variable>
<xsl:call-template name="ConvertMeasure">
<xsl:with-param name="TargetMeasure" select="'in'"/>

View File

@@ -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: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:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" 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="w wx aml o dt v">
<xsl:template name="create-default-paragraph-styles">
<xsl:variable name="default-paragraph-style" select="w:style[@w:default = 'on' and @w:type = 'paragraph']"/>
@@ -516,7 +511,7 @@
<xsl:element name="style:text-properties">
<xsl:apply-templates select="current()"/>
<!-- <xsl:call-template name="text-properties"/> -->
<!-- <xsl:call-template name="text-properties"/> -->
</xsl:element>
</xsl:element>
</xsl:template>
@@ -793,7 +788,7 @@
<xsl:template match="w:p">
<xsl:choose>
<!-- because word treats page breaks as separate tags, we must split some paragraphs up so that we can
give the sub para a fo:break-before ="page" or column attribute. -->
give the sub para a fo:break-before ="page" or column attribute. -->
<xsl:when test="w:r[w:br/@w:type='page' or w:br/@w:type='column']">
<xsl:call-template name="process-breaks-in-paragraph"/>
</xsl:when>